Bug 755934. Display notification for successful app installation. r=felipe

This commit is contained in:
Dan Walkowski 2012-07-14 01:01:07 -07:00
parent c23822e53e
commit 6ee8836765
2 changed files with 20 additions and 0 deletions

View File

@ -357,6 +357,7 @@ 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)?
webapps.install.success = Application Installed
# Telemetry opt-out prompt for Aurora and Nightly
# LOCALIZATION NOTE (telemetryOptOutPrompt): %1$S and %3$S will be replaced by

View File

@ -117,6 +117,7 @@ let webappsUI = {
}
DOMApplicationRegistry.confirmInstall(aData, false, localDir);
installationSuccessNotification(app, aWindow);
} else {
DOMApplicationRegistry.denyInstall(aData);
}
@ -141,3 +142,21 @@ let webappsUI = {
}
}
function installationSuccessNotification(app, aWindow) {
let bundle = aWindow.gNavigatorBundle;
if (("@mozilla.org/alerts-service;1" in Cc)) {
let notifier;
try {
notifier = Cc["@mozilla.org/alerts-service;1"].
getService(Ci.nsIAlertsService);
notifier.showAlertNotification(app.iconURI.spec,
bundle.getString("webapps.install.success"),
app.appNameAsFilename,
false, null, null);
} catch (ex) {}
}
}