Bug 777517 - Webapp installation alert should launch app on click. r=myk

This commit is contained in:
Marco Castelluccio 2013-07-30 18:37:00 -07:00
parent 70b6524ced
commit a13901fe5f

View File

@ -114,7 +114,7 @@ this.webappsUI = {
}
DOMApplicationRegistry.confirmInstall(aData, false, localDir);
installationSuccessNotification(app, aWindow);
installationSuccessNotification(aData, app, aWindow);
} else {
DOMApplicationRegistry.denyInstall(aData);
}
@ -140,7 +140,15 @@ this.webappsUI = {
}
}
function installationSuccessNotification(app, aWindow) {
function installationSuccessNotification(aData, app, aWindow) {
let launcher = {
observe: function(aSubject, aTopic) {
if (aTopic == "alertclickcallback") {
WebappOSUtils.launch(aData.app);
}
}
};
let bundle = aWindow.gNavigatorBundle;
if (("@mozilla.org/alerts-service;1" in Cc)) {
@ -152,7 +160,7 @@ function installationSuccessNotification(app, aWindow) {
notifier.showAlertNotification(app.iconURI.spec,
bundle.getString("webapps.install.success"),
app.appNameAsFilename,
false, null, null);
true, null, launcher);
} catch (ex) {}
}