Backed out 2 changesets (bug 1501992) for bc failures in browser/components/urlbar/tests/browser/browser_UrlbarInput_tooltip.js CLOSED TREE
authorshindli <shindli@mozilla.com>
Sat, 01 Dec 2018 07:06:36 +0200
changeset 449066 e2b33de5f4c7be06299e1d16d1d9df10a91b274e
parent 449065 fedf8f5b79e57be608f1bf82f6bbe4728692f42b
child 449067 b425a0d640af3e4132aceb85f3474b98d5b48c54
push id74138
push usershindli@mozilla.com
push dateSat, 01 Dec 2018 05:08:30 +0000
treeherderautoland@40e9134d4295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1501992
milestone65.0a1
backs outae07b833833146811d507abd3166794be91b1fa4
3ab27af474f99084e7d9a969c46937722264a90d
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
Backed out 2 changesets (bug 1501992) for bc failures in browser/components/urlbar/tests/browser/browser_UrlbarInput_tooltip.js CLOSED TREE Backed out changeset ae07b8338331 (bug 1501992) Backed out changeset 3ab27af474f9 (bug 1501992)
browser/base/content/browser-contentblocking.js
browser/base/content/test/trackingUI/benignPage.html
browser/base/content/test/trackingUI/browser.ini
browser/base/content/test/trackingUI/browser_trackingUI_categories.js
browser/base/content/test/trackingUI/browser_trackingUI_cookies_subview.js
browser/base/content/test/trackingUI/browser_trackingUI_fetch.js
browser/base/content/test/trackingUI/browser_trackingUI_open_preferences.js
browser/base/content/test/trackingUI/browser_trackingUI_pbmode_exceptions.js
browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
browser/base/content/test/trackingUI/browser_trackingUI_state.js
browser/base/content/test/trackingUI/browser_trackingUI_telemetry.js
browser/base/content/test/trackingUI/browser_trackingUI_trackers_subview.js
browser/base/content/test/trackingUI/head.js
browser/base/content/test/trackingUI/trackingAPI.js
browser/components/controlcenter/content/panel.inc.xul
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/browser.properties
browser/themes/shared/controlcenter/panel.inc.css
toolkit/components/telemetry/Events.yaml
--- a/browser/base/content/browser-contentblocking.js
+++ b/browser/base/content/browser-contentblocking.js
@@ -2,57 +2,45 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 var TrackingProtection = {
   reportBreakageLabel: "trackingprotection",
   telemetryIdentifier: "tp",
   PREF_ENABLED_GLOBALLY: "privacy.trackingprotection.enabled",
   PREF_ENABLED_IN_PRIVATE_WINDOWS: "privacy.trackingprotection.pbmode.enabled",
+  PREF_UI_ENABLED: "browser.contentblocking.trackingprotection.control-center.ui.enabled",
   PREF_TRACKING_TABLE: "urlclassifier.trackingTable",
   PREF_TRACKING_ANNOTATION_TABLE: "urlclassifier.trackingAnnotationTable",
   enabledGlobally: false,
   enabledInPrivateWindows: false,
 
   get categoryItem() {
     delete this.categoryItem;
     return this.categoryItem =
       document.getElementById("identity-popup-content-blocking-category-tracking-protection");
   },
 
-  get categoryLabel() {
-    delete this.categoryLabel;
-    return this.categoryLabel =
-      document.getElementById("identity-popup-content-blocking-tracking-protection-state-label");
-  },
-
   get subViewList() {
     delete this.subViewList;
     return this.subViewList = document.getElementById("identity-popup-trackersView-list");
   },
 
   get strictInfo() {
     delete this.strictInfo;
     return this.strictInfo = document.getElementById("identity-popup-trackersView-strict-info");
   },
 
-  strings: {
-    get subViewBlocked() {
-      delete this.subViewBlocked;
-      return this.subViewBlocked =
-        gNavigatorBundle.getString("contentBlocking.trackersView.blocked.label");
-    },
-  },
-
   init() {
     this.updateEnabled();
 
     Services.prefs.addObserver(this.PREF_ENABLED_GLOBALLY, this);
     Services.prefs.addObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this);
 
+    XPCOMUtils.defineLazyPreferenceGetter(this, "visible", this.PREF_UI_ENABLED, false);
     XPCOMUtils.defineLazyPreferenceGetter(this, "trackingTable", this.PREF_TRACKING_TABLE, false);
     XPCOMUtils.defineLazyPreferenceGetter(this, "trackingAnnotationTable", this.PREF_TRACKING_ANNOTATION_TABLE, false);
   },
 
   uninit() {
     Services.prefs.removeObserver(this.PREF_ENABLED_GLOBALLY, this);
     Services.prefs.removeObserver(this.PREF_ENABLED_IN_PRIVATE_WINDOWS, this);
   },
@@ -67,39 +55,24 @@ var TrackingProtection = {
             PrivateBrowsingUtils.isWindowPrivate(window));
   },
 
   updateEnabled() {
     this.enabledGlobally =
       Services.prefs.getBoolPref(this.PREF_ENABLED_GLOBALLY);
     this.enabledInPrivateWindows =
       Services.prefs.getBoolPref(this.PREF_ENABLED_IN_PRIVATE_WINDOWS);
-    this.updateCategoryLabel();
   },
 
-  updateCategoryLabel() {
-    let label;
-    if (this.enabled) {
-      label = "contentBlocking.trackers.blocked.label";
-    } else {
-      label = "contentBlocking.trackers.allowed.label";
-    }
-    this.categoryLabel.textContent = gNavigatorBundle.getString(label);
-  },
-
-  isBlocking(state) {
-    return (state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT) != 0;
+  isBlockerActivated(state) {
+    return state & Ci.nsIWebProgressListener.STATE_BLOCKED_TRACKING_CONTENT;
   },
 
   isAllowing(state) {
-    return (state & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT) != 0;
-  },
-
-  isDetected(state) {
-    return this.isBlocking(state) || this.isAllowing(state);
+    return state & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT;
   },
 
   async updateSubView() {
     let previousURI = gBrowser.currentURI.spec;
     let previousWindow = gBrowser.selectedBrowser.innerWindowID;
 
     let contentBlockingLogJSON = await gBrowser.selectedBrowser.getContentBlockingLog();
     let contentBlockingLog = JSON.parse(contentBlockingLogJSON);
@@ -136,17 +109,17 @@ var TrackingProtection = {
   },
 
   async _createListItem(origin, actions) {
     // Figure out if this list entry was actually detected by TP or something else.
     let isDetected = false;
     let isAllowed = false;
     for (let [state] of actions) {
       isAllowed = isAllowed || this.isAllowing(state);
-      isDetected = isDetected || isAllowed || this.isBlocking(state);
+      isDetected = isDetected || isAllowed || this.isBlockerActivated(state);
     }
 
     if (!isDetected) {
       return null;
     }
 
     let uri = Services.io.newURI(origin);
 
@@ -154,84 +127,47 @@ var TrackingProtection = {
     // need to make sure that this is a tracker that we would actually have blocked
     // before showing it to the user.
     let isTracker = await this._isOnTrackingTable(uri);
     if (!isTracker) {
       return null;
     }
 
     let listItem = document.createXULElement("hbox");
-    listItem.className = "identity-popup-content-blocking-list-item";
+    listItem.className = "identity-popup-trackersView-list-item";
     listItem.classList.toggle("allowed", isAllowed);
-    // Repeat the host in the tooltip in case it's too long
-    // and overflows in our panel.
-    listItem.tooltipText = uri.host;
 
     let image = document.createXULElement("image");
-    image.className = "identity-popup-trackersView-icon";
-    image.classList.toggle("allowed", isAllowed);
     listItem.append(image);
 
     let label = document.createXULElement("label");
     label.value = uri.host;
-    label.className = "identity-popup-content-blocking-list-host-label";
     label.setAttribute("crop", "end");
     listItem.append(label);
 
-    if (!isAllowed) {
-      let stateLabel = document.createXULElement("label");
-      stateLabel.value = this.strings.subViewBlocked;
-      stateLabel.className = "identity-popup-content-blocking-list-state-label";
-      listItem.append(stateLabel);
-    }
-
     return listItem;
   },
 };
 
 var ThirdPartyCookies = {
   telemetryIdentifier: "cr",
   PREF_ENABLED: "network.cookie.cookieBehavior",
   PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.rejecttrackers.reportBreakage.enabled",
   PREF_ENABLED_VALUES: [
     // These values match the ones exposed under the Content Blocking section
     // of the Preferences UI.
     Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN,  // Block all third-party cookies
     Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER,  // Block third-party cookies from trackers
   ],
+  PREF_UI_ENABLED: "browser.contentblocking.rejecttrackers.control-center.ui.enabled",
 
   get categoryItem() {
     delete this.categoryItem;
     return this.categoryItem =
-      document.getElementById("identity-popup-content-blocking-category-cookies");
-  },
-
-  get categoryLabel() {
-    delete this.categoryLabel;
-    return this.categoryLabel =
-      document.getElementById("identity-popup-content-blocking-cookies-state-label");
-  },
-
-  get subViewList() {
-    delete this.subViewList;
-    return this.subViewList = document.getElementById("identity-popup-cookiesView-list");
-  },
-
-  strings: {
-    get subViewAllowed() {
-      delete this.subViewAllowed;
-      return this.subViewAllowed =
-        gNavigatorBundle.getString("contentBlocking.cookiesView.allowed.label");
-    },
-
-    get subViewBlocked() {
-      delete this.subViewBlocked;
-      return this.subViewBlocked =
-        gNavigatorBundle.getString("contentBlocking.cookiesView.blocked.label");
-    },
+      document.getElementById("identity-popup-content-blocking-category-3rdpartycookies");
   },
 
   get reportBreakageLabel() {
     switch (this.behaviorPref) {
     case Ci.nsICookieService.BEHAVIOR_ACCEPT:
       return "nocookiesblocked";
     case Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN:
       return "allthirdpartycookiesblocked";
@@ -242,246 +178,50 @@ var ThirdPartyCookies = {
     default:
       Cu.reportError(`Error: Unknown cookieBehavior pref observed: ${this.behaviorPref}`);
       // fall through
     case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
       return "cookierestrictions";
     }
   },
 
+  get categoryLabelDefault() {
+    delete this.categoryLabelDefault;
+    return this.categoryLabelDefault =
+      document.getElementById("identity-popup-content-blocking-category-label-default");
+  },
+
+  get categoryLabelTrackers() {
+    delete this.categoryLabelTrackers;
+    return this.categoryLabelTrackers =
+      document.getElementById("identity-popup-content-blocking-category-label-trackers");
+  },
+
   updateCategoryLabel() {
-    let label;
-    switch (this.behaviorPref) {
-    case Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN:
-      label = "contentBlocking.cookies.3rdPartyBlocked.label";
-      break;
-    case Ci.nsICookieService.BEHAVIOR_REJECT:
-      label = "contentBlocking.cookies.allBlocked.label";
-      break;
-    case Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN:
-      label = "contentBlocking.cookies.unvisitedBlocked.label";
-      break;
-    case Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER:
-      label = "contentBlocking.cookies.trackersBlocked.label";
-      break;
-    default:
-      Cu.reportError(`Error: Unknown cookieBehavior pref observed: ${this.behaviorPref}`);
-      // fall through
-    case Ci.nsICookieService.BEHAVIOR_ACCEPT:
-      label = "contentBlocking.cookies.allowed.label";
-      break;
-    }
-    this.categoryLabel.textContent = gNavigatorBundle.getString(label);
+    let rejectTrackers = this.behaviorPref == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
+    this.categoryLabelDefault.hidden = rejectTrackers;
+    this.categoryLabelTrackers.hidden = !rejectTrackers;
   },
 
   init() {
     XPCOMUtils.defineLazyPreferenceGetter(this, "behaviorPref", this.PREF_ENABLED,
       Ci.nsICookieService.BEHAVIOR_ACCEPT, this.updateCategoryLabel.bind(this));
+    XPCOMUtils.defineLazyPreferenceGetter(this, "visible", this.PREF_UI_ENABLED, false);
     XPCOMUtils.defineLazyPreferenceGetter(this, "reportBreakageEnabled",
       this.PREF_REPORT_BREAKAGE_ENABLED, false);
     this.updateCategoryLabel();
   },
-
   get enabled() {
     return this.PREF_ENABLED_VALUES.includes(this.behaviorPref);
   },
 
-  isBlocking(state) {
+  isBlockerActivated(state) {
     return (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_TRACKER) != 0 ||
-           (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_ALL) != 0 ||
-           (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_BY_PERMISSION) != 0 ||
            (state & Ci.nsIWebProgressListener.STATE_COOKIES_BLOCKED_FOREIGN) != 0;
   },
-
-  isDetected(state) {
-    return (state & Ci.nsIWebProgressListener.STATE_COOKIES_LOADED) != 0;
-  },
-
-  async updateSubView() {
-    let contentBlockingLogJSON = await gBrowser.selectedBrowser.getContentBlockingLog();
-    let contentBlockingLog = JSON.parse(contentBlockingLogJSON);
-
-    let categories = this._processContentBlockingLog(contentBlockingLog);
-
-    this.subViewList.textContent = "";
-
-    for (let category of ["firstParty", "trackers", "thirdParty"]) {
-      if (categories[category].length) {
-        let box = document.createXULElement("vbox");
-        let label = document.createXULElement("label");
-        label.className = "identity-popup-cookiesView-list-header";
-        label.textContent = gNavigatorBundle.getString(`contentBlocking.cookiesView.${category}.label`);
-        box.appendChild(label);
-        for (let info of categories[category]) {
-          box.appendChild(this._createListItem(info));
-        }
-        this.subViewList.appendChild(box);
-      }
-    }
-  },
-
-  _hasException(origin) {
-    for (let perm of Services.perms.getAllForPrincipal(gBrowser.contentPrincipal)) {
-      if (perm.type == "3rdPartyStorage^" + origin || perm.type.startsWith("3rdPartyStorage^" + origin + "^")) {
-        return true;
-      }
-    }
-
-    let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
-    // Cookie exceptions get "inherited" from parent- to sub-domain, so we need to
-    // make sure to include parent domains in the permission check for "cookies".
-    return Services.perms.testPermissionFromPrincipal(principal, "cookie") != Services.perms.UNKNOWN_ACTION;
-  },
-
-  _clearException(origin) {
-    for (let perm of Services.perms.getAllForPrincipal(gBrowser.contentPrincipal)) {
-      if (perm.type == "3rdPartyStorage^" + origin || perm.type.startsWith("3rdPartyStorage^" + origin + "^")) {
-        Services.perms.removePermission(perm);
-      }
-    }
-
-    // OAs don't matter here, so we can just use the hostname.
-    let host = Services.io.newURI(origin).host;
-
-    // Cookie exceptions get "inherited" from parent- to sub-domain, so we need to
-    // clear any cookie permissions from parent domains as well.
-    for (let perm of Services.perms.enumerator) {
-      if (perm.type == "cookie" &&
-          Services.eTLD.hasRootDomain(host, perm.principal.URI.host)) {
-        Services.perms.removePermission(perm);
-      }
-    }
-  },
-
-  // Transforms and filters cookie entries in the content blocking log
-  // so that we can categorize and display them in the UI.
-  _processContentBlockingLog(log) {
-    let newLog = {
-      firstParty: [],
-      trackers: [],
-      thirdParty: [],
-    };
-
-    let firstPartyDomain = null;
-    try {
-      firstPartyDomain = Services.eTLD.getBaseDomain(gBrowser.currentURI);
-    } catch (e) {
-      // There are nasty edge cases here where someone is trying to set a cookie
-      // on a public suffix or an IP address. Just categorize those as third party...
-      if (e.result != Cr.NS_ERROR_HOST_IS_IP_ADDRESS &&
-          e.result != Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) {
-        throw e;
-      }
-    }
-
-    for (let [origin, actions] of Object.entries(log)) {
-      if (!origin.startsWith("http")) {
-        continue;
-      }
-
-      let info = {origin, isAllowed: true, hasException: this._hasException(origin)};
-      let hasCookie = false;
-      let isTracker = false;
-
-      // Extract information from the states entries in the content blocking log.
-      // Each state will contain a single state flag from nsIWebProgressListener.
-      // Note that we are using the same helper functions that are applied to the
-      // bit map passed to onSecurityChange (which contains multiple states), thus
-      // not checking exact equality, just presence of bits.
-      for (let [state, blocked] of actions) {
-        if (this.isDetected(state)) {
-          hasCookie = true;
-        }
-        if (TrackingProtection.isAllowing(state)) {
-          isTracker = true;
-        }
-        // blocked tells us whether the resource was actually blocked
-        // (which it may not be in case of an exception).
-        if (this.isBlocking(state) && blocked) {
-          info.isAllowed = false;
-        }
-      }
-
-      if (!hasCookie) {
-        continue;
-      }
-
-      let isFirstParty = false;
-      try {
-        let uri = Services.io.newURI(origin);
-        isFirstParty = Services.eTLD.getBaseDomain(uri) == firstPartyDomain;
-      } catch (e) {
-        if (e.result != Cr.NS_ERROR_HOST_IS_IP_ADDRESS &&
-            e.result != Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) {
-          throw e;
-        }
-      }
-
-      if (isFirstParty) {
-        newLog.firstParty.push(info);
-      } else if (isTracker) {
-        newLog.trackers.push(info);
-      } else {
-        newLog.thirdParty.push(info);
-      }
-    }
-
-    return newLog;
-  },
-
-  _createListItem({origin, isAllowed, hasException}) {
-    let listItem = document.createXULElement("hbox");
-    listItem.className = "identity-popup-content-blocking-list-item";
-    listItem.classList.toggle("allowed", isAllowed);
-    // Repeat the origin in the tooltip in case it's too long
-    // and overflows in our panel.
-    listItem.tooltipText = origin;
-
-    let image = document.createXULElement("image");
-    image.className = "identity-popup-cookiesView-icon";
-    image.classList.toggle("allowed", isAllowed);
-    listItem.append(image);
-
-    let label = document.createXULElement("label");
-    label.value = origin;
-    label.className = "identity-popup-content-blocking-list-host-label";
-    label.setAttribute("crop", "end");
-    listItem.append(label);
-
-    let stateLabel;
-    if (isAllowed && hasException) {
-      stateLabel = document.createXULElement("label");
-      stateLabel.value = this.strings.subViewAllowed;
-      stateLabel.className = "identity-popup-content-blocking-list-state-label";
-      listItem.append(stateLabel);
-    } else if (!isAllowed) {
-      stateLabel = document.createXULElement("label");
-      stateLabel.value = this.strings.subViewBlocked;
-      stateLabel.className = "identity-popup-content-blocking-list-state-label";
-      listItem.append(stateLabel);
-    }
-
-    if (hasException) {
-      let removeException = document.createXULElement("button");
-      removeException.className = "identity-popup-permission-remove-button";
-      removeException.tooltipText = gNavigatorBundle.getFormattedString(
-        "contentBlocking.cookiesView.removeButton.tooltip", [origin]);
-      removeException.addEventListener("click", () => {
-        this._clearException(origin);
-        // Just flip the display based on what state we had previously.
-        stateLabel.value = isAllowed ? this.strings.subViewBlocked : this.strings.subViewAllowed;
-        listItem.classList.toggle("allowed", !isAllowed);
-        image.classList.toggle("allowed", !isAllowed);
-        removeException.hidden = true;
-      });
-      listItem.append(removeException);
-    }
-
-    return listItem;
-  },
 };
 
 
 var ContentBlocking = {
   // If the user ignores the doorhanger, we stop showing it after some time.
   MAX_INTROS: 20,
   PREF_ANIMATIONS_ENABLED: "toolkit.cosmeticAnimations.enabled",
   PREF_REPORT_BREAKAGE_ENABLED: "browser.contentblocking.reportBreakage.enabled",
@@ -652,19 +392,21 @@ var ContentBlocking = {
     // Leave the ? at the end of the URL to signify that this URL had its query stripped.
     let urlWithoutQuery = this.reportURI.asciiSpec.replace(this.reportURI.query, "");
     let body = `Full URL: ${urlWithoutQuery}\n`;
     body += `userAgent: ${navigator.userAgent}\n`;
 
     body += "\n**Preferences**\n";
     body += `${TrackingProtection.PREF_ENABLED_GLOBALLY}: ${Services.prefs.getBoolPref(TrackingProtection.PREF_ENABLED_GLOBALLY)}\n`;
     body += `${TrackingProtection.PREF_ENABLED_IN_PRIVATE_WINDOWS}: ${Services.prefs.getBoolPref(TrackingProtection.PREF_ENABLED_IN_PRIVATE_WINDOWS)}\n`;
+    body += `${TrackingProtection.PREF_UI_ENABLED}: ${Services.prefs.getBoolPref(TrackingProtection.PREF_UI_ENABLED)}\n`;
     body += `urlclassifier.trackingTable: ${Services.prefs.getStringPref("urlclassifier.trackingTable")}\n`;
     body += `network.http.referer.defaultPolicy: ${Services.prefs.getIntPref("network.http.referer.defaultPolicy")}\n`;
     body += `network.http.referer.defaultPolicy.pbmode: ${Services.prefs.getIntPref("network.http.referer.defaultPolicy.pbmode")}\n`;
+    body += `${ThirdPartyCookies.PREF_UI_ENABLED}: ${Services.prefs.getBoolPref(ThirdPartyCookies.PREF_UI_ENABLED)}\n`;
     body += `${ThirdPartyCookies.PREF_ENABLED}: ${Services.prefs.getIntPref(ThirdPartyCookies.PREF_ENABLED)}\n`;
     body += `network.cookie.lifetimePolicy: ${Services.prefs.getIntPref("network.cookie.lifetimePolicy")}\n`;
     body += `privacy.restrict3rdpartystorage.expiration: ${Services.prefs.getIntPref("privacy.restrict3rdpartystorage.expiration")}\n`;
 
     let comments = document.getElementById("identity-popup-breakageReportView-collection-comments");
     body += "\n**Comments**\n" + comments.value;
 
     formData.set("body", body);
@@ -700,21 +442,16 @@ var ContentBlocking = {
     this.identityPopupMultiView.showSubView("identity-popup-breakageReportView");
   },
 
   async showTrackersSubview() {
     await TrackingProtection.updateSubView();
     this.identityPopupMultiView.showSubView("identity-popup-trackersView");
   },
 
-  async showCookiesSubview() {
-    await ThirdPartyCookies.updateSubView();
-    this.identityPopupMultiView.showSubView("identity-popup-cookiesView");
-  },
-
   shieldHistogramAdd(value) {
     if (PrivateBrowsingUtils.isWindowPrivate(window)) {
       return;
     }
     Services.telemetry.getHistogramById("TRACKING_PROTECTION_SHIELD").add(value);
   },
 
   onSecurityChange(oldState, state, webProgress, isSimulated,
@@ -731,80 +468,81 @@ var ContentBlocking = {
 
     // The user might have navigated before the shield animation
     // finished. In this case, reset the animation to be able to
     // play it in full again and avoid choppiness.
     if (webProgress.isTopLevel) {
       this.iconBox.removeAttribute("animate");
     }
 
-    let anyDetected = false;
-    let anyBlocking = false;
+    let anyBlockerActivated = false;
 
     for (let blocker of this.blockers) {
       // Store data on whether the blocker is activated in the current document for
       // reporting it using the "report breakage" dialog. Under normal circumstances this
       // dialog should only be able to open in the currently selected tab and onSecurityChange
       // runs on tab switch, so we can avoid associating the data with the document directly.
-      blocker.activated = blocker.isBlocking(state);
+      blocker.activated = blocker.isBlockerActivated(state);
       blocker.categoryItem.classList.toggle("blocked", blocker.enabled);
-      let detected = blocker.isDetected(state);
-      blocker.categoryItem.hidden = !detected;
-      anyDetected = anyDetected || detected;
-      anyBlocking = anyBlocking || blocker.activated;
+      blocker.categoryItem.hidden = !blocker.visible;
+      anyBlockerActivated = anyBlockerActivated || blocker.activated;
     }
 
+    // We consider the shield state "active" when some kind of blocking activity
+    // occurs on the page.  Note that merely allowing the loading of content that
+    // we could have blocked does not trigger the appearance of the shield.
+    // This state will be overriden later if there's an exception set for this site.
+    let active = anyBlockerActivated;
+    let isAllowing = state & Ci.nsIWebProgressListener.STATE_LOADED_TRACKING_CONTENT;
+    let detected = anyBlockerActivated || isAllowing;
+
     let isBrowserPrivate = PrivateBrowsingUtils.isBrowserPrivate(gBrowser.selectedBrowser);
 
     // Check whether the user has added an exception for this site.
     let type =  isBrowserPrivate ? "trackingprotection-pb" : "trackingprotection";
     let hasException = Services.perms.testExactPermission(baseURI, type) ==
       Services.perms.ALLOW_ACTION;
 
-    // We consider the shield state "active" when some kind of blocking activity
-    // occurs on the page.  Note that merely allowing the loading of content that
-    // we could have blocked does not trigger the appearance of the shield.
-    // This state will be overriden later if there's an exception set for this site.
-    this.content.toggleAttribute("detected", anyDetected);
-    this.content.toggleAttribute("blocking", anyBlocking);
+    this.content.toggleAttribute("detected", detected);
     this.content.toggleAttribute("hasException", hasException);
+    this.content.toggleAttribute("active", active);
 
-    this.iconBox.toggleAttribute("active", anyBlocking);
+    this.iconBox.toggleAttribute("active", active);
     this.iconBox.toggleAttribute("hasException", hasException);
 
     // For release (due to the large volume) we only want to receive reports
     // for breakage that is directly related to third party cookie blocking.
     if (this.reportBreakageEnabled ||
         (ThirdPartyCookies.reportBreakageEnabled &&
          ThirdPartyCookies.activated &&
          !TrackingProtection.activated)) {
       this.reportBreakageButton.removeAttribute("hidden");
     } else {
       this.reportBreakageButton.setAttribute("hidden", "true");
     }
 
     if (isSimulated) {
       this.iconBox.removeAttribute("animate");
-    } else if (anyBlocking && webProgress.isTopLevel) {
+    } else if (active && webProgress.isTopLevel) {
       this.iconBox.setAttribute("animate", "true");
 
       if (!isBrowserPrivate) {
         let introCount = Services.prefs.getIntPref(this.prefIntroCount);
         if (introCount < this.MAX_INTROS) {
           Services.prefs.setIntPref(this.prefIntroCount, ++introCount);
           Services.prefs.savePrefFile(null);
           this.showIntroPanel();
         }
       }
     }
 
     if (hasException) {
       this.iconBox.setAttribute("tooltiptext", this.disabledTooltipText);
       this.shieldHistogramAdd(1);
-    } else if (anyBlocking) {
+    } else if (active) {
       this.iconBox.setAttribute("tooltiptext", this.activeTooltipText);
       this.shieldHistogramAdd(2);
     } else {
       this.iconBox.removeAttribute("tooltiptext");
       this.shieldHistogramAdd(0);
     }
   },
 
--- a/browser/base/content/test/trackingUI/benignPage.html
+++ b/browser/base/content/test/trackingUI/benignPage.html
@@ -2,17 +2,11 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 <html dir="ltr" xml:lang="en-US" lang="en-US">
   <head>
     <meta charset="utf8">
   </head>
   <body>
-    <!--TODO: We used to have an iframe here, to double-check that benign-->
-    <!--iframes may be included in pages. However, the cookie restrictions-->
-    <!--project introduced a change that declared blockable content to be-->
-    <!--found on any page that embeds iframes, rendering this unusable for-->
-    <!--our purposes. That's not ideal and we intend to restore this iframe.-->
-    <!--(See bug 1511303 for a more detailed technical explanation.)-->
-    <!--<iframe src="http://not-tracking.example.com/"></iframe>-->
+    <iframe src="http://not-tracking.example.com/"></iframe>
   </body>
 </html>
--- a/browser/base/content/test/trackingUI/browser.ini
+++ b/browser/base/content/test/trackingUI/browser.ini
@@ -8,17 +8,16 @@ support-files =
   trackingAPI.js
   trackingPage.html
 
 [browser_trackingUI_3.js]
 [browser_trackingUI_animation.js]
 [browser_trackingUI_animation_2.js]
 [browser_trackingUI_appMenu.js]
 [browser_trackingUI_categories.js]
-[browser_trackingUI_cookies_subview.js]
 [browser_trackingUI_fetch.js]
 support-files =
   file_trackingUI_fetch.html
   file_trackingUI_fetch.js
   file_trackingUI_fetch.js^headers^
 [browser_trackingUI_open_preferences.js]
 [browser_trackingUI_pbmode_exceptions.js]
 [browser_trackingUI_report_breakage.js]
--- a/browser/base/content/test/trackingUI/browser_trackingUI_categories.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_categories.js
@@ -11,17 +11,19 @@ registerCleanupFunction(function() {
   Services.prefs.clearUserPref(TP_PB_PREF);
   Services.prefs.clearUserPref(TPC_PREF);
   Services.prefs.clearUserPref(TT_PREF);
   Services.prefs.clearUserPref(CAT_PREF);
 });
 
 add_task(async function testCategoryLabelsInControlPanel() {
   await BrowserTestUtils.withNewTab("http://www.example.com", async function() {
-    await openIdentityPopup();
+    let promisePanelOpen = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popupshown");
+    gIdentityHandler._identityBox.click();
+    await promisePanelOpen;
 
     let preferencesButton = document.getElementById("tracking-protection-preferences-button");
     ok(preferencesButton.label, "The preferencesButton label exists");
 
     Services.prefs.setStringPref(CAT_PREF, "strict");
     await TestUtils.waitForCondition(() => preferencesButton.label ==
       gNavigatorBundle.getString("contentBlocking.category.strict"));
     is(preferencesButton.label, gNavigatorBundle.getString("contentBlocking.category.strict"),
@@ -36,68 +38,16 @@ add_task(async function testCategoryLabe
     Services.prefs.setStringPref(CAT_PREF, "custom");
     await TestUtils.waitForCondition(() => preferencesButton.label ==
       gNavigatorBundle.getString("contentBlocking.category.custom"));
     is(preferencesButton.label, gNavigatorBundle.getString("contentBlocking.category.custom"),
       "The preferencesButton label has been changed to custom");
   });
 });
 
-add_task(async function testSubcategoryLabels() {
-  await BrowserTestUtils.withNewTab("http://www.example.com", async function() {
-    let categoryLabel =
-      document.getElementById("identity-popup-content-blocking-tracking-protection-state-label");
-
-    Services.prefs.setBoolPref(TP_PREF, true);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.trackers.blocked.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.trackers.blocked.label"));
-
-    Services.prefs.setBoolPref(TP_PREF, false);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.trackers.allowed.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.trackers.allowed.label"));
-
-    categoryLabel =
-      document.getElementById("identity-popup-content-blocking-cookies-state-label");
-
-    Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.cookies.allowed.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.cookies.allowed.label"));
-
-    Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.cookies.allBlocked.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.cookies.allBlocked.label"));
-
-    Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.cookies.3rdPartyBlocked.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.cookies.3rdPartyBlocked.label"));
-
-    Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.cookies.trackersBlocked.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.cookies.trackersBlocked.label"));
-
-    Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_LIMIT_FOREIGN);
-    await TestUtils.waitForCondition(() => categoryLabel.textContent ==
-      gNavigatorBundle.getString("contentBlocking.cookies.unvisitedBlocked.label"),
-      "The category label has updated correctly");
-    is(categoryLabel.textContent, gNavigatorBundle.getString("contentBlocking.cookies.unvisitedBlocked.label"));
-  });
-});
-
 add_task(async function testCategoryLabelsInAppMenu() {
   await BrowserTestUtils.withNewTab("http://www.example.com", async function() {
     let cuiTestUtils = new CustomizableUITestUtils(window);
     await cuiTestUtils.openMainMenu();
 
     let appMenuCategoryLabel = document.getElementById("appMenu-tp-category");
     ok(appMenuCategoryLabel.value, "The appMenuCategory label exists");
 
deleted file mode 100644
--- a/browser/base/content/test/trackingUI/browser_trackingUI_cookies_subview.js
+++ /dev/null
@@ -1,190 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* eslint-disable mozilla/no-arbitrary-setTimeout */
-
-"use strict";
-
-const COOKIE_PAGE = "http://not-tracking.example.com/browser/browser/base/content/test/trackingUI/cookiePage.html";
-
-const TPC_PREF = "network.cookie.cookieBehavior";
-
-add_task(async function setup() {
-  // Avoid the content blocking tour interfering with our tests by popping up.
-  await SpecialPowers.pushPrefEnv({set: [[ContentBlocking.prefIntroCount, ContentBlocking.MAX_INTROS]]});
-  await UrlClassifierTestUtils.addTestTrackers();
-
-  registerCleanupFunction(() => {
-    UrlClassifierTestUtils.cleanupTestTrackers();
-  });
-});
-
-async function assertSitesListed(trackersBlocked, thirdPartyBlocked, firstPartyBlocked) {
-  await BrowserTestUtils.withNewTab(COOKIE_PAGE, async function(browser) {
-    await openIdentityPopup();
-
-    let categoryItem =
-      document.getElementById("identity-popup-content-blocking-category-cookies");
-    ok(BrowserTestUtils.is_visible(categoryItem), "TP category item is visible");
-    let cookiesView = document.getElementById("identity-popup-cookiesView");
-    let viewShown = BrowserTestUtils.waitForEvent(cookiesView, "ViewShown");
-    categoryItem.click();
-    await viewShown;
-
-    ok(true, "Cookies view was shown");
-
-    let listHeaders = cookiesView.querySelectorAll(".identity-popup-cookiesView-list-header");
-    is(listHeaders.length, 1, "We have 1 list header");
-    is(listHeaders[0].textContent,
-       gNavigatorBundle.getString(`contentBlocking.cookiesView.trackers.label`),
-       "The list header is for tracking cookies.");
-
-    let listItems = cookiesView.querySelectorAll(".identity-popup-content-blocking-list-item");
-    is(listItems.length, 1, "We have 1 cookie in the list");
-
-    let listItem = listItems[0];
-    let label = listItem.querySelector(".identity-popup-content-blocking-list-host-label");
-    is(label.value, "http://trackertest.org", "Has an item for trackertest.org");
-    ok(BrowserTestUtils.is_visible(listItem), "List item is visible");
-    is(listItem.classList.contains("allowed"), !trackersBlocked,
-      "Indicates whether the cookie was blocked or allowed");
-
-    let mainView = document.getElementById("identity-popup-mainView");
-    viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
-    let backButton = cookiesView.querySelector(".subviewbutton-back");
-    backButton.click();
-    await viewShown;
-
-    ok(true, "Main view was shown");
-
-    let change = waitForSecurityChange();
-    let timeoutPromise = new Promise(resolve => setTimeout(resolve, 1000));
-
-    await ContentTask.spawn(browser, {}, function() {
-      content.postMessage("third-party-cookie", "*");
-    });
-
-    let result = await Promise.race([change, timeoutPromise]);
-    is(result, undefined, "No securityChange events should be received");
-
-    viewShown = BrowserTestUtils.waitForEvent(cookiesView, "ViewShown");
-    categoryItem.click();
-    await viewShown;
-
-    ok(true, "Cookies view was shown");
-
-    listHeaders = cookiesView.querySelectorAll(".identity-popup-cookiesView-list-header");
-    is(listHeaders.length, 2, "We now have 2 list headers");
-    is(listHeaders[1].textContent,
-       gNavigatorBundle.getString(`contentBlocking.cookiesView.thirdParty.label`),
-       "The new list header is for third party cookies.");
-
-    listItems = cookiesView.querySelectorAll(".identity-popup-content-blocking-list-item");
-    is(listItems.length, 2, "We have 2 cookies in the list");
-
-    listItem = listItems[1];
-    label = listItem.querySelector(".identity-popup-content-blocking-list-host-label");
-    is(label.value, "https://test1.example.org", "Has an item for test1.example.org");
-    ok(BrowserTestUtils.is_visible(listItem), "List item is visible");
-    is(listItem.classList.contains("allowed"), !thirdPartyBlocked,
-      "Indicates whether the cookie was blocked or allowed");
-
-    viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
-    backButton.click();
-    await viewShown;
-
-    ok(true, "Main view was shown");
-
-    change = waitForSecurityChange();
-    timeoutPromise = new Promise(resolve => setTimeout(resolve, 1000));
-
-    await ContentTask.spawn(browser, {}, function() {
-      content.postMessage("first-party-cookie", "*");
-    });
-
-    result = await Promise.race([change, timeoutPromise]);
-    is(result, undefined, "No securityChange events should be received");
-
-    viewShown = BrowserTestUtils.waitForEvent(cookiesView, "ViewShown");
-    categoryItem.click();
-    await viewShown;
-
-    ok(true, "Cookies view was shown");
-
-    listHeaders = cookiesView.querySelectorAll(".identity-popup-cookiesView-list-header");
-    is(listHeaders.length, 3, "We now have 3 list headers");
-    is(listHeaders[0].textContent,
-       gNavigatorBundle.getString(`contentBlocking.cookiesView.firstParty.label`),
-       "The new list header is for first party cookies.");
-
-    listItems = cookiesView.querySelectorAll(".identity-popup-content-blocking-list-item");
-    is(listItems.length, 3, "We have 2 cookies in the list");
-
-    listItem = listItems[0];
-    label = listItem.querySelector(".identity-popup-content-blocking-list-host-label");
-    is(label.value, "http://not-tracking.example.com", "Has an item for the first party");
-    ok(BrowserTestUtils.is_visible(listItem), "List item is visible");
-    is(listItem.classList.contains("allowed"), !firstPartyBlocked,
-      "Indicates whether the cookie was blocked or allowed");
-  });
-}
-
-add_task(async function testCookiesSubView() {
-  info("Testing cookies subview with reject tracking cookies.");
-  Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
-  await assertSitesListed(true, false, false);
-  info("Testing cookies subview with reject third party cookies.");
-  Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_FOREIGN);
-  await assertSitesListed(true, true, false);
-  info("Testing cookies subview with reject all cookies.");
-  Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT);
-  await assertSitesListed(true, true, true);
-  info("Testing cookies subview with accept all cookies.");
-  Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
-  await assertSitesListed(false, false, false);
-
-  Services.prefs.clearUserPref(TPC_PREF);
-});
-
-add_task(async function testCookiesSubViewAllowed() {
-  Services.prefs.setIntPref(TPC_PREF, Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER);
-  let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin("http://trackertest.org/");
-  Services.perms.addFromPrincipal(principal, "cookie", Services.perms.ALLOW_ACTION);
-
-  await BrowserTestUtils.withNewTab(COOKIE_PAGE, async function(browser) {
-    await openIdentityPopup();
-
-    let categoryItem =
-      document.getElementById("identity-popup-content-blocking-category-cookies");
-    ok(BrowserTestUtils.is_visible(categoryItem), "TP category item is visible");
-    let cookiesView = document.getElementById("identity-popup-cookiesView");
-    let viewShown = BrowserTestUtils.waitForEvent(cookiesView, "ViewShown");
-    categoryItem.click();
-    await viewShown;
-
-    ok(true, "Cookies view was shown");
-
-    let listHeaders = cookiesView.querySelectorAll(".identity-popup-cookiesView-list-header");
-    is(listHeaders.length, 1, "We have 1 list header");
-    is(listHeaders[0].textContent,
-       gNavigatorBundle.getString(`contentBlocking.cookiesView.trackers.label`),
-       "The list header is for tracking cookies.");
-
-    let listItems = cookiesView.querySelectorAll(".identity-popup-content-blocking-list-item");
-    is(listItems.length, 1, "We have 1 cookie in the list");
-
-    let listItem = listItems[0];
-    let label = listItem.querySelector(".identity-popup-content-blocking-list-host-label");
-    is(label.value, "http://trackertest.org", "Has an item for trackertest.org");
-    ok(BrowserTestUtils.is_visible(listItem), "List item is visible");
-    ok(listItem.classList.contains("allowed"), "Indicates whether the cookie was blocked or allowed");
-
-    let button = listItem.querySelector(".identity-popup-permission-remove-button");
-    ok(BrowserTestUtils.is_visible(button), "Permission remove button is visible");
-    button.click();
-    is(Services.perms.testExactPermissionFromPrincipal(principal, "cookie"), Services.perms.UNKNOWN_ACTION, "Button click should remove cookie pref.");
-    ok(!listItem.classList.contains("allowed"), "Has removed the allowed class");
-  });
-
-  Services.prefs.clearUserPref(TPC_PREF);
-});
--- a/browser/base/content/test/trackingUI/browser_trackingUI_fetch.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_fetch.js
@@ -1,10 +1,27 @@
 const URL = "http://mochi.test:8888/browser/browser/base/content/test/trackingUI/file_trackingUI_fetch.html";
 
+function waitForSecurityChange(numChanges = 1) {
+  return new Promise(resolve => {
+    let n = 0;
+    let listener = {
+      onSecurityChange() {
+        n = n + 1;
+        info("Received onSecurityChange event " + n + " of " + numChanges);
+        if (n >= numChanges) {
+          gBrowser.removeProgressListener(listener);
+          resolve();
+        }
+      },
+    };
+    gBrowser.addProgressListener(listener);
+  });
+}
+
 add_task(async function test_fetch() {
   await SpecialPowers.pushPrefEnv({ set: [
     ["privacy.trackingprotection.enabled", true],
   ]});
 
   await BrowserTestUtils.withNewTab({ gBrowser, url: URL }, async function(newTabBrowser) {
     let securityChange = waitForSecurityChange();
     await ContentTask.spawn(newTabBrowser, null, async function() {
--- a/browser/base/content/test/trackingUI/browser_trackingUI_open_preferences.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_open_preferences.js
@@ -1,15 +1,17 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
 const TP_PREF = "privacy.trackingprotection.enabled";
 const TPC_PREF = "network.cookie.cookieBehavior";
+const TP_UI_PREF = "browser.contentblocking.trackingprotection.control-center.ui.enabled";
+const RT_UI_PREF = "browser.contentblocking.rejecttrackers.control-center.ui.enabled";
 const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
 
 async function waitAndAssertPreferencesShown() {
   await BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popuphidden");
   await TestUtils.waitForCondition(() => gBrowser.currentURI.spec == "about:preferences#privacy",
     "Should open about:preferences.");
 
   await ContentTask.spawn(gBrowser.selectedBrowser, {}, async function() {
@@ -59,16 +61,18 @@ add_task(async function testOpenPreferen
 });
 
 // Tests that clicking the contentblocking category items "add blocking" labels
 // links to about:preferences
 add_task(async function testOpenPreferencesFromAddBlockingButtons() {
   SpecialPowers.pushPrefEnv({set: [
     [TP_PREF, false],
     [TPC_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT],
+    [TP_UI_PREF, true],
+    [RT_UI_PREF, true],
   ]});
 
   await BrowserTestUtils.withNewTab(TRACKING_PAGE, async function() {
     let addBlockingButtons = document.querySelectorAll(".identity-popup-content-blocking-category-add-blocking");
     for (let button of addBlockingButtons) {
       let promisePanelOpen = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popupshown");
       gIdentityHandler._identityBox.click();
       await promisePanelOpen;
--- a/browser/base/content/test/trackingUI/browser_trackingUI_pbmode_exceptions.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_pbmode_exceptions.js
@@ -52,16 +52,22 @@ function testTrackingPage(window) {
     ok(!hidden("#tracking-action-unblock-private"), "unblockButtonPrivate is visible");
   } else {
     ok(!hidden("#tracking-action-unblock"), "unblockButton is visible");
     ok(hidden("#tracking-action-unblock-private"), "unblockButtonPrivate is hidden");
   }
 
   ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
   ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
+
+  ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
+  ok(hidden("#identity-popup-content-blocking-category-tracking-protection > #identity-popup-content-blocking-tracking-protection-label-allowed"),
+    "TP category item is not showing the allowed label");
+  ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > #identity-popup-content-blocking-tracking-protection-label-blocked"),
+    "TP category item is set to blocked");
 }
 
 function testTrackingPageUnblocked() {
   info("Tracking content must be white-listed and not blocked");
   ok(ContentBlocking.content.hasAttribute("detected"), "trackers are detected");
   ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
 
   ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is active");
@@ -70,16 +76,22 @@ function testTrackingPageUnblocked() {
      gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip"), "correct tooltip");
 
   ok(BrowserTestUtils.is_visible(ContentBlocking.iconBox), "icon box is visible");
   ok(!hidden("#tracking-action-block"), "blockButton is visible");
   ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
 
   ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
   ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
+
+  ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
+  ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > #identity-popup-content-blocking-tracking-protection-label-allowed"),
+    "TP category item is showing the allowed label");
+  ok(hidden("#identity-popup-content-blocking-category-tracking-protection > #identity-popup-content-blocking-tracking-protection-label-blocked"),
+    "TP category item is not set to blocked");
 }
 
 add_task(async function testExceptionAddition() {
   await UrlClassifierTestUtils.addTestTrackers();
   let privateWin = await BrowserTestUtils.openNewBrowserWindow({private: true});
   browser = privateWin.gBrowser;
   let tab = await BrowserTestUtils.openNewForegroundTab({ gBrowser: browser, waitForLoad: true, waitForStateStop: true });
 
--- a/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
@@ -21,16 +21,23 @@ add_task(async function setup() {
   let oldCanRecord = Services.telemetry.canRecordExtended;
   Services.telemetry.canRecordExtended = true;
 
   registerCleanupFunction(() => {
     Services.telemetry.canRecordExtended = oldCanRecord;
   });
 });
 
+function openIdentityPopup() {
+  let mainView = document.getElementById("identity-popup-mainView");
+  let viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
+  gIdentityHandler._identityBox.click();
+  return viewShown;
+}
+
 add_task(async function testReportBreakageVisibility() {
   let scenarios = [
     {
       url: TRACKING_PAGE,
       prefs: {
         "privacy.trackingprotection.enabled": true,
         "browser.contentblocking.reportBreakage.enabled": true,
       },
@@ -174,19 +181,21 @@ add_task(async function testReportBreaka
         let body = CommonUtils.readBytesFromInputStream(request.bodyInputStream);
         let boundary = request.getHeader("Content-Type").match(/boundary=-+([^-]*)/i)[1];
         let regex = new RegExp("-+" + boundary + "-*\\s+");
         let sections = body.split(regex);
 
         let prefs = [
           "privacy.trackingprotection.enabled",
           "privacy.trackingprotection.pbmode.enabled",
+          "browser.contentblocking.trackingprotection.control-center.ui.enabled",
           "urlclassifier.trackingTable",
           "network.http.referer.defaultPolicy",
           "network.http.referer.defaultPolicy.pbmode",
+          "browser.contentblocking.rejecttrackers.control-center.ui.enabled",
           "network.cookie.cookieBehavior",
           "network.cookie.lifetimePolicy",
           "privacy.restrict3rdpartystorage.expiration",
         ];
         let prefsBody = "";
 
         for (let pref of prefs) {
           prefsBody += `${pref}: ${Preferences.get(pref)}\r\n`;
--- a/browser/base/content/test/trackingUI/browser_trackingUI_state.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_state.js
@@ -51,53 +51,49 @@ function clickButton(sel) {
   let el = win.document.querySelector(sel);
   el.doCommand();
 }
 
 function testBenignPage() {
   info("Non-tracking content must not be blocked");
   ok(!ContentBlocking.content.hasAttribute("detected"), "no trackers are detected");
   ok(!ContentBlocking.content.hasAttribute("hasException"), "content shows no exception");
+  ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
 
   ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is not active");
   ok(!ContentBlocking.iconBox.hasAttribute("hasException"), "icon box shows no exception");
   ok(!ContentBlocking.iconBox.hasAttribute("tooltiptext"), "icon box has no tooltip");
 
   ok(BrowserTestUtils.is_hidden(ContentBlocking.iconBox), "icon box is hidden");
   ok(hidden("#tracking-action-block"), "blockButton is hidden");
   ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
 
   ok(!hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is visible");
   ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
-  ok(hidden("#identity-popup-content-blocking-category-cookies"),
-    "Not showing cookie restrictions category");
-  ok(hidden("#identity-popup-content-blocking-category-tracking-protection"),
-    "Not showing trackers category");
+  ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
 }
 
 function testBenignPageWithException() {
   info("Non-tracking content must not be blocked");
   ok(!ContentBlocking.content.hasAttribute("detected"), "no trackers are detected");
   ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
+  ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
 
   ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is not active");
   ok(ContentBlocking.iconBox.hasAttribute("hasException"), "shield shows exception");
   is(ContentBlocking.iconBox.getAttribute("tooltiptext"),
      gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip"), "correct tooltip");
 
   ok(!BrowserTestUtils.is_hidden(ContentBlocking.iconBox), "icon box is not hidden");
   ok(!hidden("#tracking-action-block"), "blockButton is visible");
   ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
 
   ok(!hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is visible");
   ok(hidden("#identity-popup-content-blocking-detected"), "blocking detected label is hidden");
-  ok(hidden("#identity-popup-content-blocking-category-cookies"),
-    "Not showing cookie restrictions category");
-  ok(hidden("#identity-popup-content-blocking-category-tracking-protection"),
-    "Not showing trackers category");
+  ok(hidden("#identity-popup-content-blocking-category-list"), "category list is hidden");
 }
 
 function areTrackersBlocked(isPrivateBrowsing) {
   let blockedByTP = Services.prefs.getBoolPref(isPrivateBrowsing ? TP_PB_PREF : TP_PREF);
   let blockedByTPC = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
   return blockedByTP || blockedByTPC;
 }
 
@@ -105,16 +101,18 @@ function testTrackingPage(window) {
   info("Tracking content must be blocked");
   ok(ContentBlocking.content.hasAttribute("detected"), "trackers are detected");
   ok(!ContentBlocking.content.hasAttribute("hasException"), "content shows no exception");
 
   let isPrivateBrowsing = PrivateBrowsingUtils.isWindowPrivate(window);
   let blockedByTP = areTrackersBlocked(isPrivateBrowsing);
   is(BrowserTestUtils.is_visible(ContentBlocking.iconBox), blockedByTP,
      "icon box is" + (blockedByTP ? "" : " not") + " visible");
+  is(ContentBlocking.content.hasAttribute("active"), blockedByTP,
+      "content is" + (blockedByTP ? "" : " not") + " active");
   is(ContentBlocking.iconBox.hasAttribute("active"), blockedByTP,
       "shield is" + (blockedByTP ? "" : " not") + " active");
   ok(!ContentBlocking.iconBox.hasAttribute("hasException"), "icon box shows no exception");
   is(ContentBlocking.iconBox.getAttribute("tooltiptext"),
      blockedByTP ? gNavigatorBundle.getString("trackingProtection.icon.activeTooltip") : "",
      "correct tooltip");
 
   ok(hidden("#tracking-action-block"), "blockButton is hidden");
@@ -128,43 +126,79 @@ function testTrackingPage(window) {
     ok(hidden("#tracking-action-unblock-private"), "unblockButtonPrivate is hidden");
     is(!hidden("#tracking-action-unblock"), blockedByTP,
        "unblockButton is" + (blockedByTP ? "" : " not") + " visible");
   }
 
   ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
   ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
 
-  ok(!hidden("#identity-popup-content-blocking-category-tracking-protection"),
-    "Showing trackers category");
-  ok(!hidden("#identity-popup-content-blocking-category-cookies"),
-    "Showing cookie restrictions category");
+  ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
+
+  let cookiesBlocked = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
+  if (cookiesBlocked) {
+    let category = "#identity-popup-content-blocking-category-3rdpartycookies";
+    is(hidden(category + " > .identity-popup-content-blocking-category-add-blocking"), blockedByTP,
+      "Category item is" + (blockedByTP ? " not" : "") + " showing add blocking");
+    is(hidden(category + " > .identity-popup-content-blocking-category-state-label"), !blockedByTP,
+      "Category item is" + (blockedByTP ? "" : " not") + " set to blocked");
+
+    ok(hidden("#identity-popup-content-blocking-category-label-default"),
+      "Not showing default cookie restrictions label.");
+    ok(!hidden("#identity-popup-content-blocking-category-label-trackers"),
+      "Showing trackers cookie restrictions label.");
+  } else {
+    let category = "#identity-popup-content-blocking-category-tracking-protection";
+    is(hidden(category + " > #identity-popup-content-blocking-tracking-protection-label-allowed"), blockedByTP,
+      "Category item is" + (blockedByTP ? " not" : "") + " showing the allowed label");
+    is(!hidden(category + " > #identity-popup-content-blocking-tracking-protection-label-blocked"), blockedByTP,
+      "Category item is" + (blockedByTP ? "" : " not") + " set to blocked");
+
+    ok(hidden("#identity-popup-content-blocking-category-label-trackers"),
+      "Not showing trackers cookie restrictions label.");
+    ok(!hidden("#identity-popup-content-blocking-category-label-default"),
+      "Showing default cookie restrictions label.");
+  }
 }
 
 function testTrackingPageUnblocked(blockedByTP, window) {
   info("Tracking content must be white-listed and not blocked");
   ok(ContentBlocking.content.hasAttribute("detected"), "trackers are detected");
   ok(ContentBlocking.content.hasAttribute("hasException"), "content shows exception");
 
+  ok(!ContentBlocking.content.hasAttribute("active"), "content is not active");
   ok(!ContentBlocking.iconBox.hasAttribute("active"), "shield is not active");
   ok(ContentBlocking.iconBox.hasAttribute("hasException"), "shield shows exception");
   is(ContentBlocking.iconBox.getAttribute("tooltiptext"),
      gNavigatorBundle.getString("trackingProtection.icon.disabledTooltip"), "correct tooltip");
 
   ok(BrowserTestUtils.is_visible(ContentBlocking.iconBox), "icon box is visible");
   ok(!hidden("#tracking-action-block"), "blockButton is visible");
   ok(hidden("#tracking-action-unblock"), "unblockButton is hidden");
 
   ok(hidden("#identity-popup-content-blocking-not-detected"), "blocking not detected label is hidden");
   ok(!hidden("#identity-popup-content-blocking-detected"), "blocking detected label is visible");
 
-  ok(!hidden("#identity-popup-content-blocking-category-tracking-protection"),
-    "Showing trackers category");
-  ok(!hidden("#identity-popup-content-blocking-category-cookies"),
-    "Showing cookie restrictions category");
+  ok(!hidden("#identity-popup-content-blocking-category-list"), "category list is visible");
+
+  let cookiesBlocked = Services.prefs.getIntPref(TPC_PREF) == Ci.nsICookieService.BEHAVIOR_REJECT_TRACKER;
+  if (cookiesBlocked) {
+    let category = "#identity-popup-content-blocking-category-3rdpartycookies";
+    is(hidden(category + " > .identity-popup-content-blocking-category-add-blocking"), blockedByTP,
+      "Category item is" + (blockedByTP ? " not" : "") + " showing add blocking");
+    ok(!hidden("#identity-popup-content-blocking-category-tracking-protection > #identity-popup-content-blocking-tracking-protection-label-allowed"),
+      "TP category item is showing the allowed label");
+  } else {
+    let category = "#identity-popup-content-blocking-category-tracking-protection";
+    // If there's an exception we always show the "Allowed" label.
+    ok(!hidden(category + " > #identity-popup-content-blocking-tracking-protection-label-allowed"),
+      "Category item is showing the allowed label");
+    ok(hidden(category + " > #identity-popup-content-blocking-tracking-protection-label-blocked"),
+      "Category item is not set to blocked");
+  }
 }
 
 async function testContentBlocking(tab) {
   info("Testing with Tracking Protection ENABLED.");
 
   info("Load a test page not containing tracking elements");
   await promiseTabLoadEvent(tab, BENIGN_PAGE);
   testBenignPage();
--- a/browser/base/content/test/trackingUI/browser_trackingUI_telemetry.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_telemetry.js
@@ -45,17 +45,17 @@ add_task(async function setup() {
 add_task(async function testShieldHistogram() {
   Services.prefs.setBoolPref(PREF, true);
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
 
   // Reset these to make counting easier
   getShieldHistogram().clear();
 
   await promiseTabLoadEvent(tab, BENIGN_PAGE);
-  is(getShieldCounts()[0], 1, "Page loads without tracking");
+  is(getShieldCounts()[0], 2, "Page loads without tracking");
 
   await promiseTabLoadEvent(tab, TRACKING_PAGE);
   // Note that right now the shield histogram is not measuring what
   // you might think.  Since onSecurityChange fires twice for a tracking page,
   // the total page loads count is double counting, and the shield count
   // (which is meant to measure times when the shield wasn't shown) fires even
   // when tracking elements exist on the page.
   todo_is(getShieldCounts()[0], 1, "FIXME: TOTAL PAGE LOADS WITHOUT TRACKING IS DOUBLE COUNTING");
@@ -81,27 +81,32 @@ add_task(async function testShieldHistog
 add_task(async function testIdentityPopupEvents() {
   Services.prefs.setBoolPref(PREF, true);
   let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
 
   await promiseTabLoadEvent(tab, BENIGN_PAGE);
 
   Services.telemetry.clearEvents();
 
-  await openIdentityPopup();
+  let { gIdentityHandler } = gBrowser.ownerGlobal;
+  let promisePanelOpen = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popupshown");
+  gIdentityHandler._identityBox.click();
+  await promisePanelOpen;
 
   let events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true).parent;
   let openEvents = events.filter(
     e => e[1] == "security.ui.identitypopup" && e[2] == "open" && e[3] == "identity_popup");
   is(openEvents.length, 1, "recorded telemetry for opening the identity popup");
   is(openEvents[0][4], "shield-hidden", "recorded the shield as hidden");
 
   await promiseTabLoadEvent(tab, TRACKING_PAGE);
 
-  await openIdentityPopup();
+  promisePanelOpen = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popupshown");
+  gIdentityHandler._identityBox.click();
+  await promisePanelOpen;
 
   events = Services.telemetry.snapshotEvents(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true).parent;
   openEvents = events.filter(
     e => e[1] == "security.ui.identitypopup" && e[2] == "open" && e[3] == "identity_popup");
   is(openEvents.length, 1, "recorded telemetry for opening the identity popup");
   is(openEvents[0][4], "shield-showing", "recorded the shield as showing");
 
   info("Disable TP for the page (which reloads the page)");
--- a/browser/base/content/test/trackingUI/browser_trackingUI_trackers_subview.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_trackers_subview.js
@@ -4,40 +4,61 @@
 
 "use strict";
 
 const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
 
 const TP_PREF = "privacy.trackingprotection.enabled";
 
 add_task(async function setup() {
-  // Avoid the content blocking tour interfering with our tests by popping up.
-  await SpecialPowers.pushPrefEnv({set: [[ContentBlocking.prefIntroCount, ContentBlocking.MAX_INTROS]]});
   await UrlClassifierTestUtils.addTestTrackers();
+});
+
+function openIdentityPopup() {
+  let mainView = document.getElementById("identity-popup-mainView");
+  let viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
+  gIdentityHandler._identityBox.click();
+  return viewShown;
+}
 
-  registerCleanupFunction(() => {
-    UrlClassifierTestUtils.cleanupTestTrackers();
+function waitForSecurityChange(counter) {
+  return new Promise(resolve => {
+    let webProgressListener = {
+      onStateChange: () => {},
+      onStatusChange: () => {},
+      onLocationChange: () => {},
+      onSecurityChange: (webProgress, request, oldState, state) => {
+        if (--counter == 0) {
+          gBrowser.removeProgressListener(webProgressListener);
+          resolve(counter);
+        }
+      },
+      onProgressChange: () => {},
+      QueryInterface: ChromeUtils.generateQI([Ci.nsIWebProgressListener]),
+    };
+
+    gBrowser.addProgressListener(webProgressListener);
   });
-});
+}
 
 async function assertSitesListed(blocked) {
   await BrowserTestUtils.withNewTab(TRACKING_PAGE, async function(browser) {
     await openIdentityPopup();
 
     let categoryItem =
       document.getElementById("identity-popup-content-blocking-category-tracking-protection");
     ok(BrowserTestUtils.is_visible(categoryItem), "TP category item is visible");
     let trackersView = document.getElementById("identity-popup-trackersView");
     let viewShown = BrowserTestUtils.waitForEvent(trackersView, "ViewShown");
     categoryItem.click();
     await viewShown;
 
     ok(true, "Trackers view was shown");
 
-    let listItems = trackersView.querySelectorAll(".identity-popup-content-blocking-list-item");
+    let listItems = document.querySelectorAll(".identity-popup-trackersView-list-item");
     is(listItems.length, 1, "We have 1 tracker in the list");
 
     let strictInfo = document.getElementById("identity-popup-trackersView-strict-info");
     is(BrowserTestUtils.is_hidden(strictInfo), Services.prefs.getBoolPref(TP_PREF),
       "Strict info is hidden if TP is enabled.");
 
     let mainView = document.getElementById("identity-popup-mainView");
     viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
@@ -58,17 +79,17 @@ async function assertSitesListed(blocked
     is(result, undefined, "No securityChange events should be received");
 
     viewShown = BrowserTestUtils.waitForEvent(trackersView, "ViewShown");
     categoryItem.click();
     await viewShown;
 
     ok(true, "Trackers view was shown");
 
-    listItems = Array.from(trackersView.querySelectorAll(".identity-popup-content-blocking-list-item"));
+    listItems = Array.from(document.querySelectorAll(".identity-popup-trackersView-list-item"));
     is(listItems.length, 2, "We have 2 trackers in the list");
 
     let listItem = listItems.find(item => item.querySelector("label").value == "trackertest.org");
     ok(listItem, "Has an item for trackertest.org");
     ok(BrowserTestUtils.is_visible(listItem), "List item is visible");
     is(listItem.classList.contains("allowed"), !blocked,
       "Indicates whether the tracker was blocked or allowed");
 
@@ -76,24 +97,24 @@ async function assertSitesListed(blocked
     ok(listItem, "Has an item for itisatracker.org");
     ok(BrowserTestUtils.is_visible(listItem), "List item is visible");
     is(listItem.classList.contains("allowed"), !blocked,
       "Indicates whether the tracker was blocked or allowed");
   });
 }
 
 add_task(async function testTrackersSubView() {
-  info("Testing trackers subview with TP disabled.");
   Services.prefs.setBoolPref(TP_PREF, false);
   await assertSitesListed(false);
-  info("Testing trackers subview with TP enabled.");
   Services.prefs.setBoolPref(TP_PREF, true);
   await assertSitesListed(true);
-  info("Testing trackers subview with TP enabled and a CB exception.");
   let uri = Services.io.newURI("https://tracking.example.org");
   Services.perms.add(uri, "trackingprotection", Services.perms.ALLOW_ACTION);
   await assertSitesListed(false);
-  info("Testing trackers subview with TP enabled and a CB exception removed.");
   Services.perms.remove(uri, "trackingprotection");
   await assertSitesListed(true);
-
   Services.prefs.clearUserPref(TP_PREF);
 });
+
+add_task(function cleanup() {
+  Services.prefs.clearUserPref(TP_PREF);
+  UrlClassifierTestUtils.cleanupTestTrackers();
+});
--- a/browser/base/content/test/trackingUI/head.js
+++ b/browser/base/content/test/trackingUI/head.js
@@ -27,32 +27,8 @@ function promiseTabLoadEvent(tab, url) {
 
   let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
 
   if (url)
     BrowserTestUtils.loadURI(tab.linkedBrowser, url);
 
   return loaded;
 }
-
-function openIdentityPopup() {
-  let mainView = document.getElementById("identity-popup-mainView");
-  let viewShown = BrowserTestUtils.waitForEvent(mainView, "ViewShown");
-  gIdentityHandler._identityBox.click();
-  return viewShown;
-}
-
-function waitForSecurityChange(numChanges = 1) {
-  return new Promise(resolve => {
-    let n = 0;
-    let listener = {
-      onSecurityChange() {
-        n = n + 1;
-        info("Received onSecurityChange event " + n + " of " + numChanges);
-        if (n >= numChanges) {
-          gBrowser.removeProgressListener(listener);
-          resolve(n);
-        }
-      },
-    };
-    gBrowser.addProgressListener(listener);
-  });
-}
--- a/browser/base/content/test/trackingUI/trackingAPI.js
+++ b/browser/base/content/test/trackingUI/trackingAPI.js
@@ -13,25 +13,10 @@ onmessage = event => {
     }
     break;
   case "cookie": {
       let ifr = document.createElement("iframe");
       ifr.src = "https://trackertest.org/browser/browser/base/content/test/trackingUI/cookieServer.sjs";
       document.body.appendChild(ifr);
     }
     break;
-  case "first-party-cookie": {
-      // Since the content blocking log doesn't seem to get updated for
-      // top-level cookies right now, we just create an iframe with the
-      // first party domain...
-      let ifr = document.createElement("iframe");
-      ifr.src = "http://not-tracking.example.com/browser/browser/base/content/test/trackingUI/cookieServer.sjs";
-      document.body.appendChild(ifr);
-    }
-    break;
-  case "third-party-cookie": {
-      let ifr = document.createElement("iframe");
-      ifr.src = "https://test1.example.org/browser/browser/base/content/test/trackingUI/cookieServer.sjs";
-      document.body.appendChild(ifr);
-    }
-    break;
   }
 };
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -69,30 +69,37 @@
 
           <description id="identity-popup-content-blocking-detected"
                        crop="end">&contentBlocking.detected;</description>
           <description id="identity-popup-content-blocking-not-detected"
                        crop="end">&contentBlocking.notDetected;</description>
 
           <vbox id="identity-popup-content-blocking-category-list">
             <toolbarbutton id="identity-popup-content-blocking-category-tracking-protection"
-                           onclick="ContentBlocking.showTrackersSubview()"
-                           class="identity-popup-content-blocking-category" align="center">
+                  onclick="ContentBlocking.showTrackersSubview()"
+                  class="identity-popup-content-blocking-category" align="center">
               <image class="identity-popup-content-blocking-category-icon tracking-protection-icon"/>
               <label flex="1" class="identity-popup-content-blocking-category-label">&contentBlocking.trackingProtection3.label;</label>
-              <label flex="1" id="identity-popup-content-blocking-tracking-protection-state-label" class="identity-popup-content-blocking-category-state-label"/>
+              <label flex="1" id="identity-popup-content-blocking-tracking-protection-label-allowed"
+                     class="identity-popup-content-blocking-category-state-label">&contentBlocking.trackingProtection.allowed.label;</label>
+              <label flex="1" id="identity-popup-content-blocking-tracking-protection-label-blocked"
+                     class="identity-popup-content-blocking-category-state-label">&contentBlocking.trackingProtection.blocked.label;</label>
             </toolbarbutton>
-            <toolbarbutton id="identity-popup-content-blocking-category-cookies"
-                           onclick="ContentBlocking.showCookiesSubview()"
-                           class="identity-popup-content-blocking-category" align="center">
+            <hbox id="identity-popup-content-blocking-category-3rdpartycookies"
+                  class="identity-popup-content-blocking-category" align="center" role="group">
               <image class="identity-popup-content-blocking-category-icon thirdpartycookies-icon"/>
               <label flex="1" id="identity-popup-content-blocking-category-label-default"
-                     class="identity-popup-content-blocking-category-label">&contentBlocking.cookies.label;</label>
-              <label flex="1" id="identity-popup-content-blocking-cookies-state-label" class="identity-popup-content-blocking-category-state-label"/>
-            </toolbarbutton>
+                     class="identity-popup-content-blocking-category-label">&contentBlocking.3rdPartyCookies.label;</label>
+              <label flex="1" id="identity-popup-content-blocking-category-label-trackers"
+                     hidden="true" class="identity-popup-content-blocking-category-label">&contentBlocking.3rdPartyCookies.trackers.label;</label>
+              <label flex="1" class="identity-popup-content-blocking-category-state-label">&contentBlocking.3rdPartyCookies.blocking.label;</label>
+              <label flex="1" class="identity-popup-content-blocking-category-add-blocking text-link"
+                     id="identity-popup-3rdpartycookies-add-blocking"
+                     onclick="ContentBlocking.openPreferences('identityPopup-CB-3rdpartycookies'); gIdentityHandler.recordClick('cookies_add_blocking');">&contentBlocking.3rdPartyCookies.add.label;</label>
+            </hbox>
           </vbox>
 
           <button id="tracking-action-unblock"
                   class="panel-button tracking-protection-button"
                   label="&trackingProtection.unblock5.label;"
                   accesskey="&trackingProtection.unblock5.accesskey;"
                   oncommand="ContentBlocking.disableForCurrentPage(); gIdentityHandler.recordClick('unblock');" />
           <button id="tracking-action-unblock-private"
@@ -234,45 +241,30 @@
 
     </panelview>
 
     <!-- Trackers SubView -->
     <panelview id="identity-popup-trackersView"
                role="document"
                title="&contentBlocking.trackersView.label;"
                descriptionheightworkaround="true">
-        <vbox id="identity-popup-trackersView-list" class="identity-popup-content-blocking-list">
+        <vbox id="identity-popup-trackersView-list">
         </vbox>
         <hbox id="identity-popup-trackersView-strict-info">
           <image/>
           <label>&contentBlocking.trackersView.strictInfo.label;</label>
         </hbox>
         <vbox class="identity-popup-footer">
           <button id="identity-popup-trackersView-settings-button"
                   label="&contentBlocking.manageSettings.label;"
                   accesskey="&contentBlocking.manageSettings.accesskey;"
                   oncommand="ContentBlocking.openPreferences();"/>
         </vbox>
     </panelview>
 
-    <!-- Cookies SubView -->
-    <panelview id="identity-popup-cookiesView"
-               role="document"
-               title="&contentBlocking.cookiesView.label;"
-               descriptionheightworkaround="true">
-        <vbox id="identity-popup-cookiesView-list" class="identity-popup-content-blocking-list">
-        </vbox>
-        <vbox class="identity-popup-footer">
-          <button id="identity-popup-cookiesView-settings-button"
-                  label="&contentBlocking.manageSettings.label;"
-                  accesskey="&contentBlocking.manageSettings.accesskey;"
-                  oncommand="ContentBlocking.openPreferences();"/>
-        </vbox>
-    </panelview>
-
     <!-- Report Breakage SubView -->
     <panelview id="identity-popup-breakageReportView"
                title="&contentBlocking.breakageReportView.label;"
                descriptionheightworkaround="true">
         <vbox id="identity-popup-breakageReportView-heading">
           <description>&contentBlocking.breakageReportView2.description;</description>
           <label id="identity-popup-breakageReportView-learn-more"
                  class="text-link">&contentBlocking.breakageReportView.learnMore;</label>
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -964,26 +964,54 @@ you can use these alternative items. Oth
 <!ENTITY getUserMedia.audioCapture.label "Audio from the tab will be shared.">
 <!ENTITY getUserMedia.allWindowsShared.message "All visible windows on your screen will be shared.">
 
 <!ENTITY contentBlocking.title "Content Blocking">
 <!ENTITY contentBlocking.detected "Blockable content detected on this site.">
 <!ENTITY contentBlocking.notDetected "No blockable content detected on this page.">
 
 <!ENTITY contentBlocking.trackingProtection3.label "Trackers">
+<!-- LOCALIZATION NOTE (contentBlocking.trackingProtection.allowed.label):
+     This label signals that this type of content blocking is turned
+     OFF and is not blocking tracker content, so this is not
+     a positive thing. It forms the end of the (imaginary) sentence
+     "Trackers [are] Allowed"-->
+<!ENTITY contentBlocking.trackingProtection.allowed.label "Allowed">
+<!-- LOCALIZATION NOTE (contentBlocking.trackingProtection.blocked.label):
+     This label signals that this type of content blocking is turned
+     ON and is successfully blocking tracker content, so this is
+     a positive thing. It forms the end of the (imaginary) sentence
+     "Trackers [are] Blocked"-->
+<!ENTITY contentBlocking.trackingProtection.blocked.label "Blocked">
+
+<!ENTITY contentBlocking.3rdPartyCookies.label "Third-Party Cookies">
+<!ENTITY contentBlocking.3rdPartyCookies.trackers.label "Tracking Cookies">
+<!-- LOCALIZATION NOTE (contentBlocking.3rdPartyCookies.blocked.label):
+     This label signals that this type of content blocking is turned
+     ON and is successfully blocking third-party cookies, so this is
+     a positive thing. It forms the end of the (imaginary) sentence
+     "Third-Party Cookies [are] Blocked"-->
+<!ENTITY contentBlocking.3rdPartyCookies.blocked.label "Blocked">
+<!-- LOCALIZATION NOTE (contentBlocking.tranckingProtection.blocking.label):
+     This label signals that this type of content blocking is turned
+     ON, so this is a positive thing. It forms the verb in the (imaginary) sentence
+     "Firefox is blocking Third-Party Cookies"-->
+<!ENTITY contentBlocking.3rdPartyCookies.blocking.label "Blocking">
+<!-- LOCALIZATION NOTE (contentBlocking.3rdPartyCookies.add.label):
+     This is displayed as a link to preferences, where the user can add
+     this specific type of content blocking. When this text is shown
+     the type of content blocking is currently not enabled. -->
+<!ENTITY contentBlocking.3rdPartyCookies.add.label "Add Blocking…">
 
 <!ENTITY contentBlocking.manageSettings.label "Manage Content Blocking">
 <!ENTITY contentBlocking.manageSettings.accesskey "M">
 
 <!ENTITY contentBlocking.trackersView.label "Trackers">
 <!ENTITY contentBlocking.trackersView.strictInfo.label "To block all trackers, set content blocking to “Strict”.">
 
-<!ENTITY contentBlocking.cookies.label "Cookies">
-<!ENTITY contentBlocking.cookiesView.label "Cookies and Site Data">
-
 <!ENTITY contentBlocking.openBreakageReportView2.label "Report a problem">
 <!ENTITY contentBlocking.breakageReportView.label "Report Problems">
 <!ENTITY contentBlocking.breakageReportView2.description "Content blocking can cause problems with some websites. When you report problems, you’ll help make &brandShortName; better for everyone. (This will send a URL as well as information about your browser settings to Mozilla.)">
 <!ENTITY contentBlocking.breakageReportView.learnMore "Learn More">
 <!ENTITY contentBlocking.breakageReportView.collection.url.label "URL">
 <!ENTITY contentBlocking.breakageReportView.collection.comments.label "What problems did you have? (Optional)">
 <!ENTITY contentBlocking.breakageReportView.sendReport.label "Send Report">
 <!ENTITY contentBlocking.breakageReportView.cancel.label "Cancel">
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -484,59 +484,16 @@ contentBlocking.tooltip=Open Content Blo
 # The terminology used to refer to levels of Content Blocking is also used
 # in preferences and should be translated consistently.
 # LOCALIZATION NOTE (contentBlocking.category.standard):
 # "Standard" in this case is an adjective, meaning "default" or "normal"
 contentBlocking.category.standard=Standard
 contentBlocking.category.strict=Strict
 contentBlocking.category.custom=Custom
 
-# LOCALIZATION NOTE (contentBlocking.trackers.allowed.label):
-#   This label signals that this type of content blocking is turned
-#   OFF and is not blocking tracker content, so this is not
-#   a positive thing. It forms the end of the (imaginary) sentence
-#   "Trackers [are] Allowed"
-contentBlocking.trackers.allowed.label=Allowed
-# LOCALIZATION NOTE (contentBlocking.trackers.blocked.label):
-#   This label signals that this type of content blocking is turned
-#   ON and is successfully blocking tracker content, so this is
-#   a positive thing. It forms the end of the (imaginary) sentence
-#   "Trackers [are] Blocked"
-contentBlocking.trackers.blocked.label=Blocked
-
-# LOCALIZATION NOTE (contentBlocking.trackersView.blocked.label):
-#   This label is shown next to a tracker in the trackers subview.
-#   It forms the end of the (imaginary) sentence "www.example.com [was] Blocked"
-contentBlocking.trackersView.blocked.label=Blocked
-
-# LOCALIZATION NOTE (contentBlocking.cookies.allowed.label):
-#   This label signals that this type of content blocking is turned
-#   OFF and is not blocking tracker content, so this is not
-#   a positive thing. It forms the end of the (imaginary) sentence
-#   "Cookies [are] Allowed"
-contentBlocking.cookies.allowed.label=Allowed
-contentBlocking.cookies.trackersBlocked.label=Tracking Cookies Blocked
-contentBlocking.cookies.3rdPartyBlocked.label=Third-Party Cookies Blocked
-contentBlocking.cookies.unvisitedBlocked.label=Unvisited Site Cookies Blocked
-contentBlocking.cookies.allBlocked.label=All Cookies Blocked
-
-contentBlocking.cookiesView.firstParty.label=From This Site
-contentBlocking.cookiesView.trackers.label=Tracking Cookies
-contentBlocking.cookiesView.thirdParty.label=Third-Party Cookies
-# LOCALIZATION NOTE (contentBlocking.cookiesView.allowed.label):
-#   This label is shown next to a cookie origin in the cookies subview.
-#   It forms the end of the (imaginary) sentence "www.example.com [was] Allowed"
-contentBlocking.cookiesView.allowed.label=Allowed
-# LOCALIZATION NOTE (contentBlocking.cookiesView.blocked.label):
-#   This label is shown next to a cookie origin in the cookies subview.
-#   It forms the end of the (imaginary) sentence "www.example.com [was] Blocked"
-contentBlocking.cookiesView.blocked.label=Blocked
-# LOCALIZATION NOTE (contentBlocking.cookiesView.removeButton.tooltip): %S is the domain of the site.
-contentBlocking.cookiesView.removeButton.tooltip=Clear cookie exception for %S
-
 # LOCALIZATION NOTE (contentBlocking.intro.title): %S is brandShortName.
 contentBlocking.intro.title=New in %S: Content Blocking
 # LOCALIZATION NOTE (contentBlocking.v1.intro.description): %S is brandShortName.
 contentBlocking.intro.v1.description=When you see the shield, %S is blocking parts of the page that can slow your browsing or track you online.
 contentBlocking.intro.v2.description=The privacy benefits of Tracking Protection are now just one part of content blocking. When you see the shield, content blocking is on.
 # LOCALIZATION NOTE (trackingProtection.intro.step1of3): Indicates that the intro panel is step one of three in a tour.
 trackingProtection.intro.step1of3=1 of 3
 trackingProtection.intro.nextButton.label=Next
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -160,18 +160,17 @@
 }
 
 /* CONTENT */
 
 #tracking-protection-preferences-button > .toolbarbutton-text,
 .identity-popup-footer,
 .tracking-protection-button,
 #identity-popup-trackersView-strict-info > label,
-.identity-popup-cookiesView-list-header,
-.identity-popup-content-blocking-list-item > label,
+.identity-popup-trackersView-list-item > label,
 #identity-popup-mainView-panel-header > label,
 #identity-popup-trackersView > .panel-header,
 #identity-popup-securityView > .panel-header,
 #identity-popup-breakageReportView > .panel-header,
 #identity-popup-content-blocking-report-breakage,
 .identity-popup-content-blocking-category-label,
 .identity-popup-content-blocking-category-state-label,
 .identity-popup-content-blocking-category-add-blocking,
@@ -399,105 +398,76 @@ description#identity-popup-content-verif
 #identity-popup-breakageReportView-collection-comments {
   height: 120px;
 }
 
 #identity-popup-content-blocking-content {
   background-image: url("chrome://browser/skin/controlcenter/tracking-protection.svg");
 }
 
-.identity-popup-content-blocking-category {
+#identity-popup-content-blocking-category-tracking-protection {
   /* Overwrite toolbarbutton styles */
   -moz-appearance: none;
   margin: 0;
   padding-inline-start: 0;
 }
 
-.identity-popup-content-blocking-category:-moz-focusring,
-.identity-popup-content-blocking-category:hover {
+#identity-popup-content-blocking-category-tracking-protection:-moz-focusring,
+#identity-popup-content-blocking-category-tracking-protection:hover {
   border-radius: 2px;
   background-color: var(--arrowpanel-dimmed-further);
 }
 
-.identity-popup-content-blocking-category:hover:active {
+#identity-popup-content-blocking-category-tracking-protection:hover:active {
   background-color: var(--arrowpanel-dimmed-even-further);
 }
 
-.identity-popup-content-blocking-category::after {
+#identity-popup-content-blocking-category-tracking-protection::after {
   content: url(chrome://browser/skin/back-12.svg);
   -moz-context-properties: fill, fill-opacity;
   transform: scaleX(-1) translateY(1px);
   float: right;
 }
 
-.identity-popup-content-blocking-category:-moz-locale-dir(rtl)::after {
+#identity-popup-content-blocking-category-tracking-protection:-moz-locale-dir(rtl)::after {
   transform: scaleX(1) translateY(1px);
 }
 
 /* This subview could get filled with a lot of trackers, set a maximum size
  * and allow it to scroll vertically.*/
-#identity-popup-cookiesView,
 #identity-popup-trackersView {
   max-height: 600px;
 }
 
-.identity-popup-cookiesView-list-header {
-  color: var(--panel-disabled-color);
-  margin: 5px 0;
-}
-
-.identity-popup-content-blocking-list {
+#identity-popup-trackersView-list {
   padding: 5px 20px;
   -moz-box-flex: 1;
   overflow: auto;
 }
 
-.identity-popup-content-blocking-list-item {
+.identity-popup-trackersView-list-item {
   margin: 5px 0;
   overflow: hidden;
-  -moz-box-align: center;
-}
-
-.identity-popup-content-blocking-list-item:not(.allowed) {
-  color: var(--panel-disabled-color);
 }
 
-.identity-popup-content-blocking-list-host-label {
-  -moz-box-flex: 1;
+.identity-popup-trackersView-list-item > label {
+  /* Limit to full width - container padding - icon width - icon margin */
+  max-width: calc(var(--identity-popup-width) - 40px - 16px - 10px);
 }
 
-.identity-popup-content-blocking-list-state-label {
-  -moz-box-flex: 1;
-  text-align: end;
-  margin-inline-start: 5px;
-  margin-inline-end: 2px;
-}
-
-.identity-popup-trackersView-icon,
-.identity-popup-cookiesView-icon {
+.identity-popup-trackersView-list-item > image {
+  list-style-image: url(chrome://browser/skin/controlcenter/trackers-disabled.svg);
   margin-inline-end: 10px;
   -moz-context-properties: fill, fill-opacity;
 }
 
-.identity-popup-trackersView-icon {
-  list-style-image: url(chrome://browser/skin/controlcenter/trackers-disabled.svg);
-}
-
-.identity-popup-trackersView-icon.allowed {
+.identity-popup-trackersView-list-item.allowed > image {
   list-style-image: url(chrome://browser/skin/controlcenter/trackers.svg);
 }
 
-.identity-popup-cookiesView-icon {
-  list-style-image: url(chrome://browser/skin/controlcenter/3rdpartycookies-disabled.svg);
-}
-
-.identity-popup-cookiesView-icon.allowed {
-  list-style-image: url(chrome://browser/skin/controlcenter/3rdpartycookies.svg);
-}
-
 #identity-popup-trackersView-strict-info {
   min-height: 40px;
   /* Limit to full width - margin */
   max-width: calc(var(--identity-popup-width) - 12px);
   min-width: calc(var(--identity-popup-width) - 12px);
   background-color: #45a1ff80;
   margin: 6px;
   text-align: center;
@@ -522,30 +492,61 @@ description#identity-popup-content-verif
 }
 
 /* Content Blocking categories */
 
 #identity-popup-content-blocking-category-list {
   margin-top: 10px;
 }
 
+/* Don't show the categories when no trackers were detected. */
+#identity-popup-content-blocking-content:not([detected]) > #identity-popup-content-blocking-category-list {
+  display: none;
+}
+
 /* Show the "detected"/"not detected" message depending on the content state. */
 #identity-popup-content-blocking-content:not([detected]) > #identity-popup-content-blocking-detected,
 #identity-popup-content-blocking-content[detected] > #identity-popup-content-blocking-not-detected {
   display: none;
 }
 
+.identity-popup-content-blocking-category-state-label {
+  display: none;
+}
+
+/* TODO: This will be cleaned up by bug 1501992 */
+/* Hide the state label unless we blocked something only for third party cookies */
+#identity-popup-content-blocking-content:not([hasException]) #identity-popup-content-blocking-category-3rdpartycookies.blocked .identity-popup-content-blocking-category-state-label,
+/* For trackers, either show a "blocked" or "allowed" label depending on the state. */
+#identity-popup-content-blocking-content:not([hasException]) #identity-popup-content-blocking-category-tracking-protection.blocked > #identity-popup-content-blocking-tracking-protection-label-blocked,
+#identity-popup-content-blocking-category-tracking-protection:not(.blocked) > #identity-popup-content-blocking-tracking-protection-label-allowed,
+#identity-popup-content-blocking-content[hasException] #identity-popup-content-blocking-tracking-protection-label-allowed {
+  display: -moz-box;
+}
+
+.identity-popup-content-blocking-category.blocked .identity-popup-content-blocking-category-add-blocking {
+  display: none;
+}
+
 .tracking-protection-icon {
   list-style-image: url(chrome://browser/skin/controlcenter/trackers.svg);
 }
 
+#identity-popup-content-blocking-category-tracking-protection.blocked > .tracking-protection-icon {
+  list-style-image: url(chrome://browser/skin/controlcenter/trackers-disabled.svg);
+}
+
 .thirdpartycookies-icon {
   list-style-image: url(chrome://browser/skin/controlcenter/3rdpartycookies.svg);
 }
 
+#identity-popup-content-blocking-category-3rdpartycookies.blocked > .thirdpartycookies-icon {
+  list-style-image: url(chrome://browser/skin/controlcenter/3rdpartycookies-disabled.svg);
+}
+
 /* Content Blocking action button */
 
 .tracking-protection-button {
   list-style-image: url(chrome://browser/skin/tracking-protection.svg);
   -moz-appearance: none;
   margin: 1em 0 0;
   display: none;
   height: 32px;
@@ -592,25 +593,25 @@ description#identity-popup-content-verif
 
 #identity-popup-content-blocking-report-breakage {
   margin-top: 6px;
 }
 
 /* Hide the "report breakage" button if we have not detected any trackers
  * (except if the user added an exception, in which case they might still
  * (especially!) want to report the breakage). */
-#identity-popup-content-blocking-content:not([blocking]):not([hasException]) #identity-popup-content-blocking-report-breakage {
+#identity-popup-content-blocking-content:not([active]):not([hasException]) #identity-popup-content-blocking-report-breakage {
   display: none;
 }
 
 /* Show the right action buttons depending on content state */
 /* Offer to temporarily add an exception in private mode. */
-#main-window:not([privatebrowsingmode]) #identity-popup-content-blocking-content[blocking]:not([hasException]) > #tracking-action-unblock,
+#main-window:not([privatebrowsingmode]) #identity-popup-content-blocking-content[active]:not([hasException]) > #tracking-action-unblock,
 /* Offer to permanently add an exception in normal mode. */
-#main-window[privatebrowsingmode] #identity-popup-content-blocking-content[blocking]:not([hasException]) > #tracking-action-unblock-private,
+#main-window[privatebrowsingmode] #identity-popup-content-blocking-content[active]:not([hasException]) > #tracking-action-unblock-private,
 /* If there's an exception just offer to remove the exception again. */
 #identity-popup-content-blocking-content[hasException] > #tracking-action-block {
   display: -moz-box;
 }
 
 /* PERMISSIONS */
 
 #identity-popup-permissions-content {
@@ -712,17 +713,16 @@ description#identity-popup-content-verif
   margin: 0;
   border-width: 0;
   border-radius: 50%;
   min-width: 0;
   padding: 2px;
   background-color: transparent;
   color: inherit;
   opacity: 0.6;
-  margin-inline-start: 2px;
 }
 
 .identity-popup-permission-remove-button > .button-box {
   padding: 0;
 }
 
 .identity-popup-permission-remove-button > .button-box > .button-icon {
   margin: 0;
--- a/toolkit/components/telemetry/Events.yaml
+++ b/toolkit/components/telemetry/Events.yaml
@@ -623,16 +623,18 @@ security.ui.identitypopup:
       - main
     extra_keys:
       tp: Whether Tracking Protection was active while the user opened the popup
       cr: Whether Cookie Restrictions was active while the user opened the popup
     products:
       - firefox
   click:
     objects: [
+      "tp_add_blocking",
+      "cookies_add_blocking",
       "cb_prefs_button",
       "clear_sitedata",
       "unblock",
       "unblock_private",
       "block",
       "report_breakage"
     ]
     bug_numbers: