From 46d5358fe4d33d73a14d9e7b8a0295be4d839e4b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Mon, 3 Dec 2012 23:46:57 +0100 Subject: [PATCH] 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 | 6 +++++- dom/apps/src/Webapps.jsm | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dom/apps/src/Webapps.js b/dom/apps/src/Webapps.js index 48688667e79b..f25175492c33 100644 --- a/dom/apps/src/Webapps.js +++ b/dom/apps/src/Webapps.js @@ -744,8 +744,12 @@ WebappsApplicationMgmt.prototype = { 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; diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm index e1d38c98b8d9..6a79ed9a99b1 100644 --- a/dom/apps/src/Webapps.jsm +++ b/dom/apps/src/Webapps.jsm @@ -1538,7 +1538,7 @@ this.DOMApplicationRegistry = { continue; } - if (!this.webapps[id].removable) + if (!app.removable) return; // Clean up the deprecated manifest cache if needed. @@ -1569,6 +1569,7 @@ this.DOMApplicationRegistry = { 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 }); @@ -1768,13 +1769,15 @@ this.DOMApplicationRegistry = { } 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;