Bug 812119 - [HOMESCREEN] Must reboot after deleting an app to see its icon disappear from homescreen. r=fabrice
☠☠ backed out by 822a1cfc322d ☠ ☠
authorVivien Nicolas <21@vingtetun.org>
Wed, 28 Nov 2012 17:13:54 -0800
changeset 114435 4f7114a9d050df58f478c9711a6c8e0a650c1491
parent 114434 8aeaeb18da5f3a22942691a7cc96b3325feae012
child 114436 9eb8b4bd265d2cf0b6ad3917e7943b44ac7ad795
push id23917
push useremorley@mozilla.com
push dateThu, 29 Nov 2012 14:20:29 +0000
treeherdermozilla-central@c72d38e7a212 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
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
dom/apps/src/Webapps.js
dom/apps/src/Webapps.jsm
--- a/dom/apps/src/Webapps.js
+++ b/dom/apps/src/Webapps.js
@@ -744,17 +744,17 @@ WebappsApplicationMgmt.prototype = {
           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 event = new this._window.MozApplicationEvent("applicationuninstall",
-                           { application : createApplicationObject(this._window, { origin: msg.origin }) });
+                           { application : createApplicationObject(this._window, msg) });
           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
@@ -1503,17 +1503,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.
@@ -1534,17 +1534,21 @@ this.DOMApplicationRegistry = {
       let dir = this._getAppDir(id);
       try {
         dir.remove(true);
       } catch (e) {}
 
       delete this.webapps[id];
 
       this._saveApps((function() {
-        this.broadcastMessage("Webapps:Uninstall:Return:OK", aData);
+        let detail = {
+          manifestURL: app.manifestURL,
+          origin: aData.origin
+        };
+        this.broadcastMessage("Webapps:Uninstall:Return:OK", detail);
         Services.obs.notifyObservers(this, "webapps-sync-uninstall", appNote);
         this.broadcastMessage("Webapps:RemoveApp", { id: id });
       }).bind(this));
 
       return;
     }
 
     aMm.sendAsyncMessage("Webapps:Uninstall:Return:KO", aData);
@@ -1732,23 +1736,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);