Bug 812119 - [HOMESCREEN] Must reboot after deleting an app to see its icon disappear from homescreen. r=fabrice. a=blocking-basecamp
authorVivien Nicolas <21@vingtetun.org>
Mon, 03 Dec 2012 23:46:57 +0100
changeset 114842 66888378b4ac091ee5e2564b65b2a45c94d806a2
parent 114841 b6e705adb98a048b71a73ee5780d1665ae0554b3
child 114843 305129d04cd1f6362e1e29b127c202ac768a9145
push id19022
push uservnicolas@mozilla.com
push dateMon, 03 Dec 2012 22:47:11 +0000
treeherdermozilla-inbound@66888378b4ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice, blocking-basecamp
bugs812119
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 812119 - [HOMESCREEN] Must reboot after deleting an app to see its icon disappear from homescreen. r=fabrice. a=blocking-basecamp
dom/apps/src/Webapps.js
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.js
+++ b/dom/apps/src/Webapps.js
@@ -739,18 +739,22 @@ WebappsApplicationMgmt.prototype = {
           let app = msg.app;
           let event = new this._window.MozApplicationEvent("applicationinstall",
                            { application : createApplicationObject(this._window, app) });
           this._oninstall.handleEvent(event);
         }
         break;
       case "Webapps:Uninstall:Return:OK":
         if (this._onuninstall) {
+          let detail = {
+            manifestURL: msg.manifestURL,
+            origin: msg.origin
+          };
           let event = new this._window.MozApplicationEvent("applicationuninstall",
-                           { application : createApplicationObject(this._window, { origin: msg.origin }) });
+                           { application : createApplicationObject(this._window, detail) });
           this._onuninstall.handleEvent(event);
         }
         break;
     }
     this.removeRequest(msg.requestID);
   },
 
   classID: Components.ID("{8c1bca96-266f-493a-8d57-ec7a95098c15}"),
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -1533,17 +1533,17 @@ this.DOMApplicationRegistry = {
 
   uninstall: function(aData, aMm) {
     for (let id in this.webapps) {
       let app = this.webapps[id];
       if (app.origin != aData.origin) {
         continue;
       }
 
-      if (!this.webapps[id].removable)
+      if (!app.removable)
         return;
 
       // Clean up the deprecated manifest cache if needed.
       if (id in this._manifestCache) {
         delete this._manifestCache[id];
       }
 
       // Clear private data first.
@@ -1564,16 +1564,17 @@ this.DOMApplicationRegistry = {
       let dir = this._getAppDir(id);
       try {
         dir.remove(true);
       } catch (e) {}
 
       delete this.webapps[id];
 
       this._saveApps((function() {
+        aData.manifestURL = app.manifestURL;
         this.broadcastMessage("Webapps:Uninstall:Return:OK", aData);
         Services.obs.notifyObservers(this, "webapps-sync-uninstall", appNote);
         this.broadcastMessage("Webapps:RemoveApp", { id: id });
       }).bind(this));
 
       return;
     }
 
@@ -1763,23 +1764,25 @@ this.DOMApplicationRegistry = {
           continue;
 
         // Clean up the deprecated manifest cache if needed.
         if (record.id in this._manifestCache) {
           delete this._manifestCache[record.id];
         }
 
         let origin = this.webapps[record.id].origin;
+        let manifestURL = this.webapps[record.id].manifestURL;
         delete this.webapps[record.id];
         let dir = this._getAppDir(record.id);
         try {
           dir.remove(true);
         } catch (e) {
         }
-        this.broadcastMessage("Webapps:Uninstall:Return:OK", { origin: origin });
+        this.broadcastMessage("Webapps:Uninstall:Return:OK", { origin: origin,
+                                                               manifestURL: manifestURL });
       } else {
         if (this.webapps[record.id]) {
           this.webapps[record.id] = record.value;
           delete this.webapps[record.id].manifest;
         } else {
           let data = { app: record.value };
           this.confirmInstall(data, true);
           this.broadcastMessage("Webapps:Install:Return:OK", data);