Bug 1821288 - Remove "addon-install-complete" event. r=rpl

This is not used anymore.

Differential Revision: https://phabricator.services.mozilla.com/D172102
This commit is contained in:
William Durand 2023-03-15 17:37:42 +00:00
Родитель 69c3bc7560
Коммит 266814d72f
7 изменённых файлов: 7 добавлений и 92 удалений

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

@ -453,7 +453,6 @@ var gXPInstallObserver = {
// IDs of addon install related notifications
NOTIFICATION_IDS: [
"addon-install-blocked",
"addon-install-complete",
"addon-install-confirmation",
"addon-install-failed",
"addon-install-origin-blocked",
@ -992,36 +991,6 @@ var gXPInstallObserver = {
showNotification();
break;
}
case "addon-install-complete": {
let secondaryActions = null;
let numAddons = installInfo.installs.length;
if (numAddons == 1) {
messageString = gNavigatorBundle.getFormattedString(
"addonInstalled",
[installInfo.installs[0].name]
);
} else {
messageString = gNavigatorBundle.getString("addonsGenericInstalled");
messageString = PluralForm.get(numAddons, messageString);
messageString = messageString.replace("#1", numAddons);
}
action = null;
options.removeOnDismissal = true;
options.persistent = false;
PopupNotifications.show(
browser,
notificationID,
messageString,
gUnifiedExtensions.getPopupAnchorID(browser, window),
action,
secondaryActions,
options
);
break;
}
}
},
_removeProgressNotification(aBrowser) {

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

@ -1843,7 +1843,6 @@ var gBrowserInit = {
);
Services.obs.addObserver(gXPInstallObserver, "addon-install-failed");
Services.obs.addObserver(gXPInstallObserver, "addon-install-confirmation");
Services.obs.addObserver(gXPInstallObserver, "addon-install-complete");
Services.obs.addObserver(gKeywordURIFixup, "keyword-uri-fixup");
BrowserOffline.init();
@ -2533,7 +2532,6 @@ var gBrowserInit = {
gXPInstallObserver,
"addon-install-confirmation"
);
Services.obs.removeObserver(gXPInstallObserver, "addon-install-complete");
Services.obs.removeObserver(gKeywordURIFixup, "keyword-uri-fixup");
if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {

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

@ -272,15 +272,6 @@ addonConfirmInstallUnsigned.message=Caution: This site would like to install an
# #2 is the total number of add-ons being installed (at least 2)
addonConfirmInstallSomeUnsigned.message=;Caution: This site would like to install #2 add-ons in #1, some of which are unverified. Proceed at your own risk.
# LOCALIZATION NOTE (addonInstalled):
# %S is the name of the add-on
addonInstalled=%S has been installed successfully.
# LOCALIZATION NOTE (addonsGenericInstalled):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
# #1 number of add-ons
addonsGenericInstalled=#1 add-on has been installed successfully.;#1 add-ons have been installed successfully.
# LOCALIZATION NOTE (addonInstallError-1, addonInstallError-2, addonInstallError-3, addonInstallError-4, addonInstallError-5, addonInstallError-8, addonLocalInstallError-1, addonLocalInstallError-2, addonLocalInstallError-3, addonLocalInstallError-4, addonLocalInstallError-5):
# %1$S is the application name, %2$S is the add-on name
addonInstallError-1=The add-on could not be downloaded because of a connection failure.

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

@ -808,14 +808,15 @@ async function waitForNotification(notificationId) {
return window.PopupNotifications.panel;
}
// This function is similar to the one in
// toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js,
// please keep both in sync!
function getObserverTopic(aNotificationId) {
let topic = aNotificationId;
if (topic == "xpinstall-disabled") {
topic = "addon-install-disabled";
} else if (topic == "addon-progress") {
topic = "addon-install-started";
} else if (topic == "addon-install-restart") {
topic = "addon-install-complete";
} else if (topic == "addon-installed") {
topic = "webextension-install-notify";
}

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

@ -2214,22 +2214,10 @@ var AddonManagerInternal = {
install.addon.enable();
}
let needsRestart =
install.addon.pendingOperations != AddonManager.PENDING_NONE;
if (!needsRestart) {
let subject = {
wrappedJSObject: { target: browser, addon: install.addon },
};
Services.obs.notifyObservers(subject, "webextension-install-notify");
} else {
self.installNotifyObservers(
"addon-install-complete",
browser,
url,
install
);
}
let subject = {
wrappedJSObject: { target: browser, addon: install.addon },
};
Services.obs.notifyObservers(subject, "webextension-install-notify");
},
};

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

@ -53,8 +53,6 @@ function getObserverTopic(aNotificationId) {
topic = "addon-install-disabled";
} else if (topic == "addon-progress") {
topic = "addon-install-started";
} else if (topic == "addon-install-restart") {
topic = "addon-install-complete";
} else if (topic == "addon-installed") {
topic = "webextension-install-notify";
}

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

@ -131,7 +131,6 @@ var Harness = {
Services.obs.addObserver(this, "addon-install-origin-blocked");
Services.obs.addObserver(this, "addon-install-blocked");
Services.obs.addObserver(this, "addon-install-failed");
Services.obs.addObserver(this, "addon-install-complete");
// For browser_auth tests which trigger auth dialogs.
Services.obs.addObserver(this, "tabmodal-dialog-loaded");
@ -157,7 +156,6 @@ var Harness = {
Services.obs.removeObserver(self, "addon-install-origin-blocked");
Services.obs.removeObserver(self, "addon-install-blocked");
Services.obs.removeObserver(self, "addon-install-failed");
Services.obs.removeObserver(self, "addon-install-complete");
Services.obs.removeObserver(self, "tabmodal-dialog-loaded");
Services.obs.removeObserver(self, "common-dialog-loaded");
@ -532,34 +530,6 @@ var Harness = {
);
}, this);
break;
case "addon-install-complete":
installInfo.installs.forEach(function(aInstall) {
isnot(
this.runningInstalls.indexOf(aInstall),
-1,
"Should only see completed events for started installs"
);
is(aInstall.error, 0, "Completed installs should have no error");
ok(
!aInstall.appDisabled,
"Completed installs should not be appDisabled"
);
// Complete installs are either in the INSTALLED or CANCELLED state
// since the test may cancel installs the moment they complete.
ok(
aInstall.state == AddonManager.STATE_INSTALLED ||
aInstall.state == AddonManager.STATE_CANCELLED,
"Completed installs should be in the right state"
);
this.runningInstalls.splice(
this.runningInstalls.indexOf(aInstall),
1
);
}, this);
break;
case "tabmodal-dialog-loaded":
let browser = subject.ownerGlobal.gBrowser.selectedBrowser;
let prompt = browser.tabModalPromptBox.getPrompt(subject);