Bug 1473933: Part 2 - Remove more unused code. r=aswan
authorKris Maglione <maglione.k@gmail.com>
Tue, 25 Sep 2018 18:06:28 -0700
changeset 438232 21b679ea5cb6
parent 438231 d9a9e40ab5ce
child 438233 1dde355c049c
push id108258
push usermaglione.k@gmail.com
push dateWed, 26 Sep 2018 02:30:24 +0000
treeherdermozilla-inbound@21b679ea5cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1473933
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1473933: Part 2 - Remove more unused code. r=aswan Differential Revision: https://phabricator.services.mozilla.com/D6868
browser/app/profile/firefox.js
browser/base/content/browser-addons.js
browser/base/content/urlbarBindings.xml
toolkit/mozapps/extensions/AddonManager.jsm
toolkit/mozapps/extensions/test/browser/browser_file_xpi_no_process_switch.js
toolkit/mozapps/extensions/test/browser/head.js
toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
toolkit/mozapps/extensions/test/xpinstall/head.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -28,17 +28,16 @@ pref("extensions.logging.enabled", false
 
 // Disables strict compatibility, making addons compatible-by-default.
 pref("extensions.strictCompatibility", false);
 
 // Temporary preference to forcibly make themes more safe with Australis even if
 // extensions.checkCompatibility=false has been set.
 pref("extensions.checkCompatibility.temporaryThemeOverride_minAppVersion", "29.0a1");
 
-pref("xpinstall.customConfirmationUI", true);
 pref("extensions.webextPermissionPrompts", true);
 pref("extensions.webextOptionalPermissionPrompts", true);
 
 // Preferences for AMO integration
 pref("extensions.getAddons.cache.enabled", true);
 pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/api/v3/addons/search/?guid=%IDS%&lang=%LOCALE%");
 pref("extensions.getAddons.compatOverides.url", "https://services.addons.mozilla.org/api/v3/addons/compat-override/?guid=%IDS%&lang=%LOCALE%");
 pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
--- a/browser/base/content/browser-addons.js
+++ b/browser/base/content/browser-addons.js
@@ -328,21 +328,17 @@ var gXPInstallObserver = {
       options.contentWindow = browser.contentWindow;
       options.sourceURI = browser.currentURI;
       options.eventCallback = function(aEvent) {
         switch (aEvent) {
           case "shown":
             let notificationElement = [...this.owner.panel.children]
                                       .find(n => n.notification == this);
             if (notificationElement) {
-              if (Services.prefs.getBoolPref("xpinstall.customConfirmationUI", false)) {
-                notificationElement.setAttribute("mainactiondisabled", "true");
-              } else {
-                notificationElement.button.hidden = true;
-              }
+              notificationElement.setAttribute("mainactiondisabled", "true");
             }
             break;
           case "removed":
             options.contentWindow = null;
             options.sourceURI = null;
             break;
         }
       };
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -3114,24 +3114,20 @@ file, You can obtain one at http://mozil
             if (maxProgress >= 0)
               maxProgress += aInstall.maxProgress;
             if (aInstall.state < AddonManager.STATE_DOWNLOADED)
               downloadingCount++;
           });
 
           if (downloadingCount == 0) {
             this.destroy();
-            if (Services.prefs.getBoolPref("xpinstall.customConfirmationUI", false)) {
-              this.progressmeter.setAttribute("mode", "undetermined");
-              let status = gNavigatorBundle.getString("addonDownloadVerifying");
-              this.progresstext.setAttribute("value", status);
-              this.progresstext.setAttribute("tooltiptext", status);
-            } else {
-              PopupNotifications.remove(this.notification);
-            }
+            this.progressmeter.setAttribute("mode", "undetermined");
+            let status = gNavigatorBundle.getString("addonDownloadVerifying");
+            this.progresstext.setAttribute("value", status);
+            this.progresstext.setAttribute("tooltiptext", status);
           } else {
             this.setProgress(progress, maxProgress);
           }
         ]]></body>
       </method>
 
       <method name="onDownloadProgress">
         <body><![CDATA[
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -28,17 +28,16 @@ const PREF_EM_LAST_PLATFORM_VERSION   = 
 const PREF_EM_AUTOUPDATE_DEFAULT      = "extensions.update.autoUpdateDefault";
 const PREF_EM_STRICT_COMPATIBILITY    = "extensions.strictCompatibility";
 const PREF_EM_CHECK_UPDATE_SECURITY   = "extensions.checkUpdateSecurity";
 const PREF_SYS_ADDON_UPDATE_ENABLED   = "extensions.systemAddon.update.enabled";
 
 const PREF_MIN_WEBEXT_PLATFORM_VERSION = "extensions.webExtensionsMinPlatformVersion";
 const PREF_WEBAPI_TESTING             = "extensions.webapi.testing";
 const PREF_WEBEXT_PERM_PROMPTS        = "extensions.webextPermissionPrompts";
-const PREF_XPINSTALL_DIALOG           = "extensions.xpinstall.confirm.dialog";
 
 const UPDATE_REQUEST_VERSION          = 2;
 
 const XMLURI_BLOCKLIST                = "http://www.mozilla.org/2006/addons-blocklist";
 
 const KEY_PROFILEDIR                  = "ProfD";
 const KEY_APPDIR                      = "XCurProcD";
 const FILE_BLOCKLIST                  = "blocklist.xml";
@@ -66,17 +65,16 @@ ChromeUtils.import("resource://gre/modul
 
 XPCOMUtils.defineLazyGlobalGetters(this, ["DOMParser", "Element"]);
 
 XPCOMUtils.defineLazyModuleGetters(this, {
   AddonRepository: "resource://gre/modules/addons/AddonRepository.jsm",
   Extension: "resource://gre/modules/Extension.jsm",
   FileUtils: "resource://gre/modules/FileUtils.jsm",
   LightweightThemeManager: "resource://gre/modules/LightweightThemeManager.jsm",
-  PromptUtils: "resource://gre/modules/SharedPromptUtils.jsm",
 });
 
 XPCOMUtils.defineLazyPreferenceGetter(this, "WEBEXT_PERMISSION_PROMPTS",
                                       PREF_WEBEXT_PERM_PROMPTS, false);
 
 // Initialize the WebExtension process script service as early as possible,
 // since it needs to be able to track things like new frameLoader globals that
 // are created before other framework code has been initialized.
@@ -2567,59 +2565,18 @@ var AddonManagerInternal = {
           try {
             let prompt = Cc["@mozilla.org/addons/web-install-prompt;1"].
                                       getService(Ci.amIWebInstallPrompt);
             prompt.confirm(browser, url, [proxy]);
             return;
           } catch (e) {}
         }
 
-        if (Services.prefs.getBoolPref("xpinstall.customConfirmationUI", false)) {
-          this.installNotifyObservers("addon-install-confirmation",
-                                      browser, url, proxy);
-          return;
-        }
-
-        let args = {};
-        args.url = url;
-        args.installs = [proxy];
-        args.wrappedJSObject = args;
-
-        try {
-          Services.telemetry.getHistogramById("SECURITY_UI")
-                  .add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
-          let parentWindow = null;
-          if (browser) {
-            // Find the outer browser
-            let docShell = browser.ownerGlobal.docShell;
-            if (docShell.itemType == Ci.nsIDocShellTreeItem.typeContent)
-              browser = docShell.chromeEventHandler;
-
-            parentWindow = browser.ownerGlobal;
-            PromptUtils.fireDialogEvent(parentWindow, "DOMWillOpenModalDialog", browser);
-          }
-
-          // Ugh modal dialogs...
-          let reallyReject = reject;
-          let cancelled = false;
-          reject = () => {
-            cancelled = true;
-          };
-          Services.ww.openWindow(parentWindow,
-                                 Services.prefs.getStringPref(PREF_XPINSTALL_DIALOG),
-                                 null, "chrome,modal,centerscreen", args);
-          if (cancelled) {
-            reallyReject();
-          }
-        } catch (e) {
-          logger.warn("Exception showing install confirmation dialog", e);
-          // Cancel the install, as currently there is no way to make it fail
-          // from here.
-          reject();
-        }
+        this.installNotifyObservers("addon-install-confirmation",
+                                    browser, url, proxy);
       } else {
         resolve();
       }
     });
   },
 
   webAPI: {
     // installs maps integer ids to AddonInstall instances.
--- a/toolkit/mozapps/extensions/test/browser/browser_file_xpi_no_process_switch.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_file_xpi_no_process_switch.js
@@ -87,15 +87,11 @@ async function testOpenedAndDraggedXPI(a
   await newTabInstallNotification;
   BrowserTestUtils.removeTab(newTab);
   await CheckBrowserInPid(aBrowser, browserPid,
                           "Check that browser has not switched process.");
 }
 
 // Test for bug 1175267.
 add_task(async function() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["xpinstall.customConfirmationUI", true]],
-  });
-
   await BrowserTestUtils.withNewTab("http://example.com", testOpenedAndDraggedXPI);
   await BrowserTestUtils.withNewTab("about:robots", testOpenedAndDraggedXPI);
 });
--- a/toolkit/mozapps/extensions/test/browser/head.js
+++ b/toolkit/mozapps/extensions/test/browser/head.js
@@ -25,17 +25,16 @@ const SECURE_TESTROOT = "https://example
 const TESTROOT2 = "http://example.org/" + RELATIVE_DIR;
 const SECURE_TESTROOT2 = "https://example.org/" + RELATIVE_DIR;
 const CHROMEROOT = pathParts.join("/") + "/";
 const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
 const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane";
 const PREF_XPI_ENABLED = "xpinstall.enabled";
 const PREF_UPDATEURL = "extensions.update.url";
 const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
-const PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI = "xpinstall.customConfirmationUI";
 const PREF_UI_LASTCATEGORY = "extensions.ui.lastCategory";
 
 const MANAGER_URI = "about:addons";
 const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
 const PREF_STRICT_COMPAT = "extensions.strictCompatibility";
 
 var PREF_CHECK_COMPATIBILITY;
 (function() {
@@ -51,17 +50,16 @@ var PREF_CHECK_COMPATIBILITY;
   PREF_CHECK_COMPATIBILITY = "extensions.checkCompatibility." + version;
 })();
 
 var gPendingTests = [];
 var gTestsRun = 0;
 var gTestStart = null;
 
 var gRestorePrefs = [{name: PREF_LOGGING_ENABLED},
-                     {name: PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI},
                      {name: "extensions.webservice.discoverURL"},
                      {name: "extensions.update.url"},
                      {name: "extensions.update.background.url"},
                      {name: "extensions.update.enabled"},
                      {name: "extensions.update.autoUpdateDefault"},
                      {name: "extensions.getAddons.get.url"},
                      {name: "extensions.getAddons.getWithPerformance.url"},
                      {name: "extensions.getAddons.cache.enabled"},
@@ -81,18 +79,16 @@ for (let pref of gRestorePrefs) {
     pref.value = Services.prefs.getIntPref(pref.name);
   else if (pref.type == Services.prefs.PREF_STRING)
     pref.value = Services.prefs.getCharPref(pref.name);
 }
 
 // Turn logging on for all tests
 Services.prefs.setBoolPref(PREF_LOGGING_ENABLED, true);
 
-Services.prefs.setBoolPref(PREF_CUSTOM_XPINSTALL_CONFIRMATION_UI, false);
-
 function promiseFocus(window) {
   return new Promise(resolve => waitForFocus(resolve, window));
 }
 
 // Helper to register test failures and close windows if any are left open
 function checkOpenWindows(aWindowID) {
   let found = false;
   for (let win of Services.wm.getEnumerator(aWindowID)) {
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_doorhanger_installs.js
@@ -6,22 +6,16 @@ const SECUREROOT = "https://example.com/
 const PROGRESS_NOTIFICATION = "addon-progress";
 
 ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
 
 const CHROMEROOT = extractChromeRoot(gTestPath);
 
 var gApp = document.getElementById("bundle_brand").getString("brandShortName");
 
-add_task(async function setup() {
-  await SpecialPowers.pushPrefEnv({
-    set: [[PREF_CUSTOM_CONFIRMATION_UI, true]],
-  });
-});
-
 function waitForTick() {
   return new Promise(resolve => executeSoon(resolve));
 }
 
 function getObserverTopic(aNotificationId) {
   let topic = aNotificationId;
   if (topic == "xpinstall-disabled")
     topic = "addon-install-disabled";
--- a/toolkit/mozapps/extensions/test/xpinstall/head.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/head.js
@@ -4,17 +4,16 @@ const RELATIVE_DIR = "toolkit/mozapps/ex
 
 const TESTROOT = "http://example.com/browser/" + RELATIVE_DIR;
 const TESTROOT2 = "http://example.org/browser/" + RELATIVE_DIR;
 const PROMPT_URL = "chrome://global/content/commonDialog.xul";
 const ADDONS_URL = "chrome://mozapps/content/extensions/extensions.xul";
 const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
 const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
 const PREF_INSTALL_REQUIRESECUREORIGIN = "extensions.install.requireSecureOrigin";
-const PREF_CUSTOM_CONFIRMATION_UI = "xpinstall.customConfirmationUI";
 const CHROME_NAME = "mochikit";
 
 function getChromeRoot(path) {
   if (path === undefined) {
     return "chrome://" + CHROME_NAME + "/content/browser/" + RELATIVE_DIR;
   }
   return getRootDirectory(path);
 }
@@ -24,21 +23,16 @@ function extractChromeRoot(path) {
   var jar = getJar(chromeRootPath);
   if (jar) {
     var tmpdir = extractJarToTmp(jar);
     return "file://" + tmpdir.path + "/";
   }
   return chromeRootPath;
 }
 
-Services.prefs.setBoolPref(PREF_CUSTOM_CONFIRMATION_UI, false);
-registerCleanupFunction(() => {
-  Services.prefs.clearUserPref(PREF_CUSTOM_CONFIRMATION_UI);
-});
-
 /**
  * This is a test harness designed to handle responding to UI during the process
  * of installing an XPI. A test can set callbacks to hear about specific parts
  * of the sequence.
  * Before use setup must be called and finish must be called afterwards.
  */
 var Harness = {
   // If set then the callback is called when an install is attempted and