From e927913e2a74ff362b722116cf40bb0b08e89128 Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Fri, 29 Jun 2012 13:46:21 -0700 Subject: [PATCH] Bug 768276. Part 2 - Use isLaunchable in existing mozApps calls to only return launchable apps. r=jst --- dom/apps/src/Webapps.jsm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm index 3af4cca665c..d5e3db81649 100644 --- a/dom/apps/src/Webapps.jsm +++ b/dom/apps/src/Webapps.jsm @@ -297,7 +297,7 @@ let DOMApplicationRegistry = { let tmp = []; let id = this._appId(aData.origin); - if (id) { + if (id && this._isLaunchable(aData.origin)) { let app = this._cloneAppObject(this.webapps[id]); aData.apps.push(app); tmp.push({ id: id }); @@ -313,10 +313,10 @@ let DOMApplicationRegistry = { getInstalled: function(aData) { aData.apps = []; let tmp = []; - let id = this._appId(aData.origin); - for (id in this.webapps) { - if (this.webapps[id].installOrigin == aData.origin) { + for (let id in this.webapps) { + if (this.webapps[id].installOrigin == aData.origin && + this._isLaunchable(aData.origin)) { aData.apps.push(this._cloneAppObject(this.webapps[id])); tmp.push({ id: id }); } @@ -335,6 +335,9 @@ let DOMApplicationRegistry = { for (let id in this.webapps) { let app = this._cloneAppObject(this.webapps[id]); + if (!this._isLaunchable(app.installOrigin)) + continue; + aData.apps.push(app); tmp.push({ id: id }); }