Bug 896436 - Notes Plus app update - fail during oauth redirect. r=ferjm, a=leo+
authorFabrice Desré <fabrice@mozilla.com>
Wed, 24 Jul 2013 10:15:37 -0700
changeset 119812 c196ea4390f8ffa610f492ee9750ac2cf696ebb4
parent 119811 a9f1d82103c6d762474ac16ce6d8cdcb1bfd83a5
child 119813 3258648233dcc4a61cca5d97813646ca0264eec9
push id1006
push userryanvm@gmail.com
push dateFri, 26 Jul 2013 16:57:26 +0000
reviewersferjm, leo
bugs896436
milestone18.1
Bug 896436 - Notes Plus app update - fail during oauth redirect. r=ferjm, a=leo+
dom/apps/src/AppsService.js
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/AppsService.js
+++ b/dom/apps/src/AppsService.js
@@ -105,18 +105,18 @@ AppsService.prototype = {
 
           if (index != -1) {
             to += spec.substring(index);
           }
           debug('App specific redirection from ' + spec + ' to ' + to);
           return Services.io.newURI(to, null, null);
         }
       }
-    } else {
-      return null;
     }
+    // No matching redirect.
+    return null;
   },
 
   classID : APPS_SERVICE_CID,
   QueryInterface : XPCOMUtils.generateQI([Ci.nsIAppsService])
 }
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppsService])
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -2000,16 +2000,17 @@ this.DOMApplicationRegistry = {
         manFile.append("manifest.webapp");
         this._writeFile(manFile, JSON.stringify(aManifest), function() { });
         // Set state and fire events.
         app.installState = "installed";
         app.downloading = false;
         app.downloadAvailable = false;
         this._saveApps((function() {
           this.updateAppHandlers(null, aManifest, appObject);
+          this.broadcastMessage("Webapps:AddApp", { id: aId, app: appObject });
 
           // Update the permissions for this app.
           PermissionsInstaller.installPermissions({ manifest: aManifest,
                                                     origin: appObject.origin,
                                                     manifestURL: appObject.manifestURL },
                                                   true);
           debug("About to fire Webapps:PackageEvent 'installed'");
           this.broadcastMessage("Webapps:PackageEvent",