Bug 1456243: Remove dead prompt-for-distribution-add-ons code. r=aswan

MozReview-Commit-ID: B4HPk0ho7Cz

--HG--
extra : rebase_source : 35c163e652d4f885405a2fc1d79259b3fb17f4b6
This commit is contained in:
Kris Maglione 2018-05-17 18:56:50 -07:00
parent 10b1f3e064
commit 980ae197a0
5 changed files with 1 additions and 83 deletions

View File

@ -53,7 +53,6 @@ var ExtensionsUI = {
await Services.wm.getMostRecentWindow("navigator:browser").delayedStartupPromise;
this._checkForSideloaded();
this._checkNewDistroAddons();
},
async _checkForSideloaded() {
@ -95,60 +94,6 @@ var ExtensionsUI = {
}
},
async _checkNewDistroAddons() {
let newDistroAddons = AddonManagerPrivate.getNewDistroAddons();
if (!newDistroAddons) {
return;
}
for (let id of newDistroAddons) {
let addon = await AddonManager.getAddonByID(id);
let win = Services.wm.getMostRecentWindow("navigator:browser");
if (!win) {
return;
}
let {gBrowser} = win;
let browser = gBrowser.selectedBrowser;
// The common case here is that we enter this code right after startup
// in a brand new profile so we haven't yet loaded a page. That state is
// surprisingly difficult to detect but wait until we've actually loaded
// a page.
if (browser.currentURI.spec == "about:blank" ||
browser.webProgress.isLoadingDocument) {
await new Promise(resolve => {
let listener = {
onLocationChange(browser_, webProgress, ...ignored) {
if (webProgress.isTopLevel && browser_ == browser) {
gBrowser.removeTabsProgressListener(listener);
resolve();
}
},
};
gBrowser.addTabsProgressListener(listener);
});
}
// If we're at about:newtab and the url bar gets focus, that will
// prevent a doorhanger from displaying.
// Our elegant solution is to ... take focus away from the url bar.
win.gURLBar.blur();
let strings = this._buildStrings({
addon,
permissions: addon.userPermissions,
});
let accepted = await this.showPermissionsPrompt(browser, strings,
addon.iconURL);
if (accepted) {
addon.userDisabled = false;
}
}
},
_updateNotifications() {
if (this.sideloaded.size + this.updates.size == 0) {
AppMenuNotifications.removeNotification("addon-alert");

View File

@ -2849,17 +2849,6 @@ var AddonManagerPrivate = {
.getNewSideloads();
},
/**
* Gets a set of (ids of) distribution addons which were installed into the
* current profile at browser startup, or null if none were installed.
*
* @return {Set<String> | null}
*/
getNewDistroAddons() {
return AddonManagerInternal._getProviderByName("XPIProvider")
.getNewDistroAddons();
},
get browserUpdated() {
return gBrowserUpdated;
},

View File

@ -78,7 +78,6 @@ XPCOMUtils.defineLazyServiceGetters(this, {
const hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
const PREF_DISTRO_ADDONS_PERMS = "extensions.distroAddons.promptForPermissions";
const PREF_INSTALL_REQUIRESECUREORIGIN = "extensions.install.requireSecureOrigin";
const PREF_PENDING_OPERATIONS = "extensions.pendingOperations";
const PREF_SYSTEM_ADDON_UPDATE_URL = "extensions.systemAddon.update.url";
@ -3441,13 +3440,6 @@ var XPIInstall = {
// Install the add-on
addon._sourceBundle = location.installer.installAddon({ id, source: file, action: "copy" });
if (Services.prefs.getBoolPref(PREF_DISTRO_ADDONS_PERMS, false)) {
addon.userDisabled = true;
if (!XPIProvider.newDistroAddons) {
XPIProvider.newDistroAddons = new Set();
}
XPIProvider.newDistroAddons.add(id);
}
XPIStates.addAddon(addon);
logger.debug(`Installed distribution add-on ${id}`);

View File

@ -1862,8 +1862,6 @@ var XPIProvider = {
activeAddons: new Map(),
// True if the platform could have activated extensions
extensionsActive: false,
// New distribution addons awaiting permissions approval
newDistroAddons: null,
// Keep track of startup phases for telemetry
runPhase: XPI_STARTING,
// Per-addon telemetry information
@ -2416,12 +2414,6 @@ var XPIProvider = {
return changed;
},
getNewDistroAddons() {
let addons = this.newDistroAddons;
this.newDistroAddons = null;
return addons;
},
getDependentAddons(aAddon) {
return Array.from(XPIDatabase.getAddons())
.filter(addon => addon.dependencies.includes(aAddon.id));

View File

@ -18,7 +18,7 @@ const IGNORE_PRIVATE = ["AddonAuthor", "AddonCompatibilityOverride",
"AddonScreenshot", "AddonType", "startup", "shutdown",
"addonIsActive", "registerProvider", "unregisterProvider",
"addStartupChange", "removeStartupChange",
"getNewSideloads", "getNewDistroAddons",
"getNewSideloads",
"recordTimestamp", "recordSimpleMeasure",
"recordException", "getSimpleMeasures", "simpleTimer",
"setTelemetryDetails", "getTelemetryDetails",