Bug 1250453 - Remove DOMApplicationRegistry._isLaunchable property. r=myk

This commit is contained in:
Marco Castelluccio 2016-03-14 16:28:25 +00:00
Родитель 87d630bebf
Коммит aa9629f603
1 изменённых файлов: 9 добавлений и 42 удалений

Просмотреть файл

@ -2547,8 +2547,7 @@ this.DOMApplicationRegistry = {
// Disallow reinstalls from the same manifest url for now.
for (let id in this.webapps) {
if (this.webapps[id].manifestURL == app.manifestURL &&
this._isLaunchable(this.webapps[id])) {
if (this.webapps[id].manifestURL == app.manifestURL) {
sendError("REINSTALL_FORBIDDEN");
return false;
}
@ -2679,7 +2678,7 @@ this.DOMApplicationRegistry = {
// Disallow reinstalls from the same manifest URL for now.
let id = this._appIdForManifestURL(app.manifestURL);
if (id !== null && this._isLaunchable(this.webapps[id])) {
if (id !== null) {
sendError("REINSTALL_FORBIDDEN");
return false;
}
@ -3141,13 +3140,7 @@ this.DOMApplicationRegistry = {
if (!aData.isPackage) {
this.updateAppHandlers(null, app.manifest, app);
if (aInstallSuccessCallback) {
try {
yield aInstallSuccessCallback(app, app.manifest);
} catch (e) {
// Ignore exceptions during the local installation of
// an app. If it fails, the app will anyway be considered
// as not installed because isLaunchable will return false.
}
yield aInstallSuccessCallback(app, app.manifest);
}
}
@ -3237,13 +3230,7 @@ this.DOMApplicationRegistry = {
aNewApp.manifestURL, aManifest);
if (aInstallSuccessCallback) {
try {
yield aInstallSuccessCallback(aNewApp, aManifest, zipFile.path);
} catch (e) {
// Ignore exceptions during the local installation of
// an app. If it fails, the app will anyway be considered
// as not installed because isLaunchable will return false.
}
yield aInstallSuccessCallback(aNewApp, aManifest, zipFile.path);
}
MessageBroadcaster.broadcastMessage("Webapps:UpdateState", {
@ -4018,7 +4005,7 @@ this.DOMApplicationRegistry = {
debug("Setting origin to " + uri.prePath +
" for " + aOldApp.manifestURL);
let newId = uri.prePath.substring(6); // "app://".length
if (newId in this.webapps && this._isLaunchable(this.webapps[newId])) {
if (newId in this.webapps) {
throw "DUPLICATE_ORIGIN";
}
aOldApp.origin = uri.prePath;
@ -4297,8 +4284,7 @@ this.DOMApplicationRegistry = {
for (let id in this.webapps) {
if (this.webapps[id].origin == aData.origin &&
this.webapps[id].localId == aData.appId &&
this._isLaunchable(this.webapps[id])) {
this.webapps[id].localId == aData.appId) {
let app = AppsUtils.cloneAppObject(this.webapps[id]);
aData.apps.push(app);
tmp.push({ id: id });
@ -4323,8 +4309,7 @@ this.DOMApplicationRegistry = {
let tmp = [];
for (let appId in this.webapps) {
if (this.webapps[appId].manifestURL == aData.manifestURL &&
this._isLaunchable(this.webapps[appId])) {
if (this.webapps[appId].manifestURL == aData.manifestURL) {
aData.app = AppsUtils.cloneAppObject(this.webapps[appId]);
tmp.push({ id: appId });
break;
@ -4345,8 +4330,7 @@ this.DOMApplicationRegistry = {
let tmp = [];
for (let id in this.webapps) {
if (this.webapps[id].installOrigin == aData.origin &&
this._isLaunchable(this.webapps[id])) {
if (this.webapps[id].installOrigin == aData.origin) {
aData.apps.push(AppsUtils.cloneAppObject(this.webapps[id]));
tmp.push({ id: id });
}
@ -4361,20 +4345,7 @@ this.DOMApplicationRegistry = {
getNotInstalled: function(aData, aMm) {
aData.apps = [];
let tmp = [];
for (let id in this.webapps) {
if (!this._isLaunchable(this.webapps[id])) {
aData.apps.push(AppsUtils.cloneAppObject(this.webapps[id]));
tmp.push({ id: id });
}
}
this._readManifests(tmp).then((aResult) => {
for (let i = 0; i < aResult.length; i++)
aData.apps[i].manifest = aResult[i].manifest;
aMm.sendAsyncMessage("Webapps:GetNotInstalled:Return:OK", this.formatMessage(aData));
});
aMm.sendAsyncMessage("Webapps:GetNotInstalled:Return:OK", this.formatMessage(aData));
},
getIcon: function(aData, aMm) {
@ -4803,10 +4774,6 @@ this.DOMApplicationRegistry = {
}
},
_isLaunchable: function(aApp) {
return true;
},
_notifyCategoryAndObservers: function(subject, topic, data, msg) {
const serviceMarker = "service,";