Bug 812119 - [HOMESCREEN] Must reboot after deleting an app to see its icon disappear from homescreen. r=fabrice

This commit is contained in:
Vivien Nicolas 2012-11-28 17:13:54 -08:00
parent d08b3f224f
commit 49dc71d8fe
2 changed files with 10 additions and 4 deletions

View File

@ -749,7 +749,7 @@ WebappsApplicationMgmt.prototype = {
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;

View File

@ -1508,7 +1508,7 @@ this.DOMApplicationRegistry = {
continue;
}
if (!this.webapps[id].removable)
if (!app.removable)
return;
// Clean up the deprecated manifest cache if needed.
@ -1539,7 +1539,11 @@ this.DOMApplicationRegistry = {
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));
@ -1737,13 +1741,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;