Bug 1476879 - Remove the privacy.trackingprotection.ui.enabled pref. r=flod,jaws
authorJohann Hofmann <jhofmann@mozilla.com>
Thu, 19 Jul 2018 10:34:28 +0200
changeset 427499 db6f301d2fd9be209d51ce46795398e59892cd68
parent 427498 c1e307c1e6ec83a053ceeac73fef451eaf58346e
child 427500 803bf61b6073389cd9605929e14ecb2785318e9f
push id34306
push usercsabou@mozilla.com
push dateFri, 20 Jul 2018 21:41:18 +0000
treeherdermozilla-central@d6a5e8aea651 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflod, jaws
bugs1476879
milestone63.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 1476879 - Remove the privacy.trackingprotection.ui.enabled pref. r=flod,jaws MozReview-Commit-ID: IsY8Oy8kmVQ
browser/app/profile/firefox.js
browser/components/preferences/in-content/extensionControlled.js
browser/components/preferences/in-content/privacy.js
browser/components/preferences/in-content/privacy.xul
browser/components/preferences/in-content/tests/browser_extension_controlled.js
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_2.js
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_6.js
browser/locales/en-US/browser/preferences/preferences.ftl
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1497,17 +1497,16 @@ pref("toolkit.telemetry.hybridContent.en
 pref("browser.ping-centre.telemetry", true);
 pref("browser.ping-centre.log", false);
 pref("browser.ping-centre.staging.endpoint", "https://onyx_tiles.stage.mozaws.net/v3/links/ping-centre");
 pref("browser.ping-centre.production.endpoint", "https://tiles.services.mozilla.com/v3/links/ping-centre");
 
 // Enable GMP support in the addon manager.
 pref("media.gmp-provider.enabled", true);
 
-pref("privacy.trackingprotection.ui.enabled", true);
 pref("privacy.trackingprotection.introCount", 0);
 pref("privacy.trackingprotection.introURL", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/tracking-protection/start/");
 #ifdef NIGHTLY_BUILD
 pref("privacy.trackingprotection.appMenuToggle.enabled", true);
 #else
 pref("privacy.trackingprotection.appMenuToggle.enabled", false);
 #endif
 
--- a/browser/components/preferences/in-content/extensionControlled.js
+++ b/browser/components/preferences/in-content/extensionControlled.js
@@ -12,19 +12,16 @@ ChromeUtils.defineModuleGetter(this, "Ad
                                   "resource://gre/modules/AddonManager.jsm");
 ChromeUtils.defineModuleGetter(this, "BrowserUtils",
                                   "resource://gre/modules/BrowserUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "DeferredTask",
                                   "resource://gre/modules/DeferredTask.jsm");
 ChromeUtils.defineModuleGetter(this, "ExtensionSettingsStore",
                                   "resource://gre/modules/ExtensionSettingsStore.jsm");
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "trackingprotectionUiEnabled",
-                                      "privacy.trackingprotection.ui.enabled");
-
 const PREF_SETTING_TYPE = "prefs";
 const PROXY_KEY = "proxy.settings";
 const API_PROXY_PREFS = [
   "network.proxy.type",
   "network.proxy.http",
   "network.proxy.http_port",
   "network.proxy.share_proxy_settings",
   "network.proxy.ftp",
@@ -44,20 +41,17 @@ let extensionControlledContentIds = {
   "privacy.containers": "browserContainersExtensionContent",
   "homepage_override": "browserHomePageExtensionContent",
   "newTabURL": "browserNewTabExtensionContent",
   "defaultSearch": "browserDefaultSearchExtensionContent",
   "proxy.settings": "proxyExtensionContent",
   get "websites.trackingProtectionMode"() {
     return {
       button: "trackingProtectionExtensionContentButton",
-      section:
-        trackingprotectionUiEnabled ?
-          "trackingProtectionExtensionContentLabel" :
-          "trackingProtectionPBMExtensionContentLabel",
+      section: "trackingProtectionExtensionContentLabel",
     };
   }
 };
 
 const extensionControlledL10nKeys = {
   "homepage_override": "homepage-override",
   "newTabURL": "new-tab-url",
   "defaultSearch": "default-search",
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -13,19 +13,16 @@ ChromeUtils.import("resource://gre/modul
 
 ChromeUtils.defineModuleGetter(this, "PluralForm",
   "resource://gre/modules/PluralForm.jsm");
 ChromeUtils.defineModuleGetter(this, "LoginHelper",
   "resource://gre/modules/LoginHelper.jsm");
 ChromeUtils.defineModuleGetter(this, "SiteDataManager",
   "resource:///modules/SiteDataManager.jsm");
 
-XPCOMUtils.defineLazyPreferenceGetter(this, "trackingprotectionUiEnabled",
-                                      "privacy.trackingprotection.ui.enabled");
-
 ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 const PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
 
 const TRACKING_PROTECTION_KEY = "websites.trackingProtectionMode";
 const TRACKING_PROTECTION_PREFS = ["privacy.trackingprotection.enabled",
                                    "privacy.trackingprotection.pbmode.enabled"];
 
@@ -143,72 +140,41 @@ var gPrivacyPane = {
   _pane: null,
 
   /**
    * Whether the prompt to restart Firefox should appear when changing the autostart pref.
    */
   _shouldPromptForRestart: true,
 
   /**
-   * Show the Tracking Protection UI depending on the
-   * privacy.trackingprotection.ui.enabled pref, and linkify its Learn More link
+   * Initialize the tracking protection prefs and linkify its Learn More link.
    */
   _initTrackingProtection() {
-    if (!trackingprotectionUiEnabled) {
-      return;
-    }
-
     let link = document.getElementById("trackingProtectionLearnMore");
     let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection";
     link.setAttribute("href", url);
 
     this.trackingProtectionReadPrefs();
-
-    document.getElementById("trackingProtectionExceptions").hidden = false;
-    document.getElementById("trackingProtectionBox").hidden = false;
-    document.getElementById("trackingProtectionPBMBox").hidden = true;
-  },
-
-  /**
-   * Linkify the Learn More link of the Private Browsing Mode Tracking
-   * Protection UI.
-   */
-  _initTrackingProtectionPBM() {
-    if (trackingprotectionUiEnabled) {
-      return;
-    }
-
-    let link = document.getElementById("trackingProtectionLearnMore");
-    let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "tracking-protection-pbm";
-    link.setAttribute("href", url);
-
-    this._updateTrackingProtectionUI();
   },
 
   /**
    * Update the tracking protection UI to deal with extension control.
    */
   _updateTrackingProtectionUI() {
     let isLocked = TRACKING_PROTECTION_PREFS.some(
       pref => Services.prefs.prefIsLocked(pref));
 
     function setInputsDisabledState(isControlled) {
       let disabled = isLocked || isControlled;
-      if (trackingprotectionUiEnabled) {
-        document.querySelectorAll("#trackingProtectionRadioGroup > radio")
-          .forEach((element) => {
-            element.disabled = disabled;
-          });
-        document.querySelector("#trackingProtectionDesc > label")
-          .disabled = disabled;
-      } else {
-        document.getElementById("trackingProtectionPBM").disabled = disabled;
-        document.getElementById("trackingProtectionPBMLabel")
-          .disabled = disabled;
-      }
+      document.querySelectorAll("#trackingProtectionRadioGroup > radio")
+        .forEach((element) => {
+          element.disabled = disabled;
+        });
+      document.querySelector("#trackingProtectionDesc > label")
+        .disabled = disabled;
     }
 
     if (isLocked) {
       // An extension can't control this setting if either pref is locked.
       hideControllingExtension(TRACKING_PROTECTION_KEY);
       setInputsDisabledState(false);
     } else {
       handleControllingExtension(
@@ -259,17 +225,16 @@ var gPrivacyPane = {
 
     this._updateSanitizeSettingsButton();
     this.initializeHistoryMode();
     this.updateAutoplayMediaControlsVisibility();
     this.updateHistoryModePane();
     this.updatePrivacyMicroControls();
     this.initAutoStartPrivateBrowsingReverter();
     this._initTrackingProtection();
-    this._initTrackingProtectionPBM();
     this._initTrackingProtectionExtensionControl();
     this._initAutocomplete();
 
     Preferences.get("privacy.sanitize.sanitizeOnShutdown").on("change",
       gPrivacyPane._updateSanitizeSettingsButton.bind(gPrivacyPane));
     Preferences.get("browser.privatebrowsing.autostart").on("change",
       gPrivacyPane.updatePrivacyMicroControls.bind(gPrivacyPane));
     Preferences.get("privacy.trackingprotection.enabled").on("change",
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -288,17 +288,17 @@
       <vbox flex="1">
         <description data-l10n-id="tracking-desc">
           <html:a id="trackingProtectionLearnMore" data-l10n-name="learn-more" target="_blank" class="learnMore text-link"/>
         </description>
       </vbox>
       <spacer flex="1"/>
     </hbox>
     <hbox>
-      <vbox id="trackingProtectionBox" flex="1" hidden="true">
+      <vbox id="trackingProtectionBox" flex="1">
         <vbox>
           <hbox id="trackingProtectionExtensionContentLabel" align="center" hidden="true">
             <description control="disableTrackingProtectionExtension" flex="1"/>
           </hbox>
           <vbox>
             <description id="trackingProtectionDesc"
                          control="trackingProtectionRadioGroup">
               <label data-l10n-id="tracking-mode-label"/>
@@ -309,42 +309,28 @@
               <radio value="private"
                      data-l10n-id="tracking-mode-private"/>
               <radio value="never"
                      data-l10n-id="tracking-mode-never"/>
             </radiogroup>
           </vbox>
         </vbox>
       </vbox>
-      <vbox id="trackingProtectionPBMBox" flex="1">
-        <hbox id="trackingProtectionPBMExtensionContentLabel" align="center" hidden="true">
-          <description control="disableTrackingProtectionExtension" flex="1"/>
-        </hbox>
-        <hbox align="start">
-          <checkbox id="trackingProtectionPBM"
-                    preference="privacy.trackingprotection.pbmode.enabled"/>
-          <label id="trackingProtectionPBMLabel"
-                 flex="1"
-                 control="trackingProtectionPBM"
-                 data-l10n-id="tracking-pbm-label"/>
-        </hbox>
-      </vbox>
       <vbox id="trackingProtectionAdvancedSettings">
         <hbox id="trackingProtectionExtensionContentButton" hidden="true">
           <button id="disableTrackingProtectionExtension"
                   class="extension-controlled-button accessory-button"
                   flex="1"
                   data-l10n-id="disable-extension"/>
         </hbox>
         <!-- Please don't remove the wrapping hbox/vbox/box for these elements. It's used to properly compute the search tooltip position. -->
         <hbox>
           <button id="trackingProtectionExceptions"
                   class="accessory-button"
                   flex="1"
-                  hidden="true"
                   data-l10n-id="tracking-exceptions"
                   preference="pref.privacy.disable_button.tracking_protection_exceptions"
                   search-l10n-ids="
                     permissions-remove.label,
                     permissions-remove-all.label,
                     permissions-button-cancel.label,
                     permissions-button-ok.label,
                     permissions-exceptions-tracking-protection-window.title,
--- a/browser/components/preferences/in-content/tests/browser_extension_controlled.js
+++ b/browser/components/preferences/in-content/tests/browser_extension_controlled.js
@@ -511,71 +511,58 @@ add_task(async function testExtensionCon
   // Don't finalize the current store since it will write out the bad data.
   await ExtensionSettingsStore._reloadFile(false);
 
   is(ExtensionSettingsStore.getSetting("prefs", "homepage_override"), null,
      "The ExtensionSettingsStore is left empty.");
 });
 
 add_task(async function testExtensionControlledTrackingProtection() {
-  const TP_UI_PREF = "privacy.trackingprotection.ui.enabled";
   const TP_PREF = "privacy.trackingprotection.enabled";
   const TP_DEFAULT = false;
   const EXTENSION_ID = "@set_tp";
-  const CONTROLLED_LABEL_ID = {
-    new: "trackingProtectionExtensionContentLabel",
-    old: "trackingProtectionPBMExtensionContentLabel"
-  };
+  const CONTROLLED_LABEL_ID = "trackingProtectionExtensionContentLabel";
   const CONTROLLED_BUTTON_ID = "trackingProtectionExtensionContentButton";
 
   let tpEnabledPref = () => Services.prefs.getBoolPref(TP_PREF);
 
   await SpecialPowers.pushPrefEnv(
-    {"set": [[TP_PREF, TP_DEFAULT], [TP_UI_PREF, true]]});
+    {"set": [[TP_PREF, TP_DEFAULT]]});
 
   function background() {
     browser.privacy.websites.trackingProtectionMode.set({value: "always"});
   }
 
   function verifyState(isControlled) {
     is(tpEnabledPref(), isControlled, "TP pref is set to the expected value.");
 
-    let controlledLabel = doc.getElementById(CONTROLLED_LABEL_ID[uiType]);
+    let controlledLabel = doc.getElementById(CONTROLLED_LABEL_ID);
 
     is(controlledLabel.hidden, !isControlled, "The extension controlled row's visibility is as expected.");
     is(controlledButton.hidden, !isControlled, "The disable extension button's visibility is as expected.");
     if (isControlled) {
       let controlledDesc = controlledLabel.querySelector("description");
       Assert.deepEqual(doc.l10n.getAttributes(controlledDesc), {
         id: "extension-controlled-websites-tracking-protection-mode",
         args: {
           name: "set_tp",
         }
       }, "The user is notified that an extension is controlling TP.");
     }
 
-    if (uiType === "new") {
-      for (let element of doc.querySelectorAll("#trackingProtectionRadioGroup > radio")) {
-        is(element.disabled, isControlled, "TP controls are enabled.");
-      }
-      is(doc.querySelector("#trackingProtectionDesc > label").disabled,
-         isControlled,
-         "TP control label is enabled.");
-    } else {
-      is(doc.getElementById("trackingProtectionPBM").disabled,
-         isControlled,
-         "TP control is enabled.");
-      is(doc.getElementById("trackingProtectionPBMLabel").disabled,
-         isControlled,
-         "TP control label is enabled.");
+    for (let element of doc.querySelectorAll("#trackingProtectionRadioGroup > radio")) {
+      is(element.disabled, isControlled, "TP controls are enabled.");
     }
+    is(doc.querySelector("#trackingProtectionDesc > label").disabled,
+       isControlled,
+       "TP control label is enabled.");
   }
 
   async function disableViaClick() {
-    let labelId = CONTROLLED_LABEL_ID[uiType];
+    let labelId = CONTROLLED_LABEL_ID;
     let controlledLabel = doc.getElementById(labelId);
 
     let enableMessageShown = waitForEnableMessage(labelId);
     doc.getElementById("disableTrackingProtectionExtension").click();
     await enableMessageShown;
 
     // The user is notified how to enable the extension.
     let controlledDesc = controlledLabel.querySelector("description");
@@ -585,23 +572,21 @@ add_task(async function testExtensionCon
 
     // The user can dismiss the enable instructions.
     let hidden = waitForMessageHidden(labelId);
     controlledLabel.querySelector("image:last-of-type").click();
     await hidden;
   }
 
   async function reEnableExtension(addon) {
-    let controlledMessageShown = waitForMessageShown(CONTROLLED_LABEL_ID[uiType]);
+    let controlledMessageShown = waitForMessageShown(CONTROLLED_LABEL_ID);
     await addon.enable();
     await controlledMessageShown;
   }
 
-  let uiType = "new";
-
   await openPreferencesViaOpenPreferencesAPI("panePrivacy", {leaveOpen: true});
   let doc = gBrowser.contentDocument;
 
   is(gBrowser.currentURI.spec, "about:preferences#privacy",
    "#privacy should be in the URI for about:preferences");
 
   let controlledButton = doc.getElementById(CONTROLLED_BUTTON_ID);
 
@@ -613,33 +598,27 @@ add_task(async function testExtensionCon
     manifest: {
       name: "set_tp",
       applications: {gecko: {id: EXTENSION_ID}},
       permissions: ["privacy"],
     },
     background,
   });
 
-  let messageShown = waitForMessageShown(CONTROLLED_LABEL_ID[uiType]);
+  let messageShown = waitForMessageShown(CONTROLLED_LABEL_ID);
   await extension.startup();
   await messageShown;
   let addon = await AddonManager.getAddonByID(EXTENSION_ID);
 
   verifyState(true);
 
   await disableViaClick();
 
   verifyState(false);
 
-  // Switch to the "old" Tracking Protection UI.
-  uiType = "old";
-  Services.prefs.setBoolPref(TP_UI_PREF, false);
-
-  verifyState(false);
-
   await reEnableExtension(addon);
 
   verifyState(true);
 
   await disableViaClick();
 
   verifyState(false);
 
--- a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_2.js
+++ b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_2.js
@@ -1,17 +1,16 @@
 /*
 * This file contains tests for the Preferences search bar.
 */
 
 // Enabling Searching functionatily. Will display search bar form this testcase forward.
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [
     ["browser.preferences.search", true],
-    ["privacy.trackingprotection.ui.enabled", true]
   ]});
 });
 
 /**
  * Test for searching for the "Saved Logins" subdialog.
  */
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
--- a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_6.js
+++ b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_6.js
@@ -1,17 +1,16 @@
 /*
 * This file contains tests for the Preferences search bar.
 */
 
 // Enabling Searching functionatily. Will display search bar form this testcase forward.
 add_task(async function() {
   await SpecialPowers.pushPrefEnv({"set": [
     ["browser.preferences.search", true],
-    ["privacy.trackingprotection.ui.enabled", true]
   ]});
 });
 
 /**
  * Test for searching for the "Block Lists" subdialog.
  */
 add_task(async function() {
   await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true});
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -798,21 +798,16 @@ tracking-mode-always =
     .accesskey = y
 tracking-mode-private =
     .label = Only in private windows
     .accesskey = l
 tracking-mode-never =
     .label = Never
     .accesskey = N
 
-# This string is displayed if privacy.trackingprotection.ui.enabled is set to false.
-# This currently happens on the release and beta channel.
-tracking-pbm-label = Use Tracking Protection in Private Browsing to block known trackers
-    .accesskey = v
-
 tracking-exceptions =
     .label = Exceptions…
     .accesskey = x
 
 tracking-change-block-list =
     .label = Change Block List…
     .accesskey = C