Bug 1167146 - Use the displayOrigin option for the web app installation notification. r=myk

--HG--
extra : rebase_source : d3e2c10effb02b5f215642fdf84e119a75137966
This commit is contained in:
Dão Gottwald 2015-05-27 12:45:49 +02:00
parent 377b315e0a
commit 7d60734a4a
2 changed files with 15 additions and 16 deletions

View File

@ -488,8 +488,8 @@ processHang.button.accessKey = O
# Webapps notification popup
webapps.install = Install
webapps.install.accesskey = I
#LOCALIZATION NOTE (webapps.requestInstall) %1$S is the web app name, %2$S is the site from which the web app is installed
webapps.requestInstall = Do you want to install "%1$S" from this site (%2$S)?
#LOCALIZATION NOTE (webapps.requestInstall2) %S is the web app name
webapps.requestInstall2 = Do you want to install “%S” from this site?
webapps.install.success = Application Installed
webapps.install.inprogress = Installation in progress
webapps.uninstall = Uninstall
@ -497,7 +497,7 @@ webapps.uninstall.accesskey = U
webapps.doNotUninstall = Don't Uninstall
webapps.doNotUninstall.accesskey = D
#LOCALIZATION NOTE (webapps.requestUninstall) %1$S is the web app name
webapps.requestUninstall = Do you want to uninstall "%1$S"?
webapps.requestUninstall = Do you want to uninstall “%1$S”?
# LOCALIZATION NOTE (fullscreen.entered): displayed when we enter HTML5 fullscreen mode, %S is the domain name of the focused website (e.g. mozilla.com).
fullscreen.entered=%S is now fullscreen.

View File

@ -207,17 +207,16 @@ this.WebappManager = {
let app = aData.app;
let manifest = new ManifestHelper(jsonManifest, app.origin, app.manifestURL);
let host;
let options = {};
try {
host = requestingURI.host;
options.displayOrigin = requestingURI.host;
} catch(e) {
host = requestingURI.spec;
options.displayOrigin = requestingURI.spec;
}
let message = bundle.getFormattedString("webapps.requestInstall",
[manifest.name, host], 2);
let message = bundle.getFormattedString("webapps.requestInstall2",
[manifest.name]);
let eventCallback = null;
let gBrowser = chromeWin.gBrowser;
if (gBrowser) {
let windowID = aData.oid;
@ -232,14 +231,14 @@ this.WebappManager = {
gBrowser.addProgressListener(listener);
eventCallback = (event) => {
options.eventCallback = event => {
if (event != "removed") {
return;
}
// The notification was removed, so we should
// remove our listener.
gBrowser.removeProgressListener(listener);
}
};
}
notification = chromeWin.PopupNotifications.show(aBrowser,
@ -247,7 +246,7 @@ this.WebappManager = {
message,
"webapps-notification-icon",
mainAction, [],
eventCallback);
options);
},
doUninstall: function(aData, aBrowser) {
@ -284,7 +283,7 @@ this.WebappManager = {
[manifest.name]);
let eventCallback = null;
let options = {};
let gBrowser = chromeWin.gBrowser;
if (gBrowser) {
let windowID = aData.oid;
@ -299,21 +298,21 @@ this.WebappManager = {
gBrowser.addProgressListener(listener);
eventCallback = (event) => {
options.eventCallback = event => {
if (event != "removed") {
return;
}
// The notification was removed, so we should
// remove our listener.
gBrowser.removeProgressListener(listener);
}
};
}
notification = chromeWin.PopupNotifications.show(
aBrowser, "webapps-uninstall", message,
"webapps-notification-icon",
mainAction, [secondaryAction],
eventCallback);
options);
}
}