diff --git a/suite/common/bindings/notification.xml b/suite/common/bindings/notification.xml index 7a01adca9d..58571b62f0 100644 --- a/suite/common/bindings/notification.xml +++ b/suite/common/bindings/notification.xml @@ -151,57 +151,8 @@ switch (aTopic) { case "addon-install-blocked": var installInfo = aSubject.QueryInterface(Components.interfaces.amIWebInstallInfo); - if (installInfo.originatingWindow.top != browser.contentWindow) - return; - - var notificationName, messageString, buttons, host; - try { - // this fails with nsSimpleURIs like data: URIs - host = installInfo.originatingURI.host; - } catch (ex) { - host = this._stringBundle.GetStringFromName("xpinstallHostNotAvailable"); - } - - if (!this._prefs.getBoolPref("xpinstall.enabled")) { - notificationName = "xpinstall-disabled"; - if (this._prefs.prefIsLocked("xpinstall.enabled")) { - messageString = this._stringBundle.GetStringFromName("xpinstallDisabledMessageLocked"); - buttons = []; - } else { - var prefBranch = this._prefs; - messageString = this._stringBundle.GetStringFromName("xpinstallDisabledMessage"); - buttons = [{ - label: this._stringBundle.GetStringFromName("xpinstallDisabledButton"), - accessKey: this._stringBundle.GetStringFromName("xpinstallDisabledButton.accesskey"), - popup: null, - callback: function editPrefs() { - prefBranch.setBoolPref("xpinstall.enabled", true); - return false; - } - }]; - } - } else { - notificationName = "xpinstall"; - var brandShortName = this._brandStringBundle.GetStringFromName("brandShortName"); - messageString = this._stringBundle.formatStringFromName("xpinstallPromptWarning", - [brandShortName, host], 2); - buttons = [{ - label: this._stringBundle.GetStringFromName("xpinstallPromptInstallButton"), - accessKey: this._stringBundle.GetStringFromName("xpinstallPromptInstallButton.accesskey"), - popup: null, - callback: function allowInstall() { - installInfo.install(); - return false; - } - }]; - } - - if (!this.getNotificationWithValue(notificationName)) { - const priority = this.PRIORITY_WARNING_MEDIUM; - const iconURL = "chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png"; - this.appendNotification(messageString, notificationName, - iconURL, priority, buttons); - } + if (installInfo.originatingWindow.top == browser.contentWindow) + this.addonInstallBlocked(installInfo); break; case "nsPref:changed": @@ -465,6 +416,63 @@ + + + + + + +