Bug 1477042 - Add a pref for counting URIs in private browsing mode. r=mikedeboer
☠☠ backed out by 6b0d60723f1c ☠ ☠
authorMichael Kaply <mozilla@kaply.com>
Fri, 27 Jul 2018 20:00:12 +0000
changeset 428799 c03547ff07973aa3f3c6b46903d914a585f39f1b
parent 428798 bc10207e894dc24c7ab729a0106259f0a249a38d
child 428800 57adf58922e0bcaccdde06aa739a0d290cce9f98
push id34345
push userrgurzau@mozilla.com
push dateSat, 28 Jul 2018 09:44:50 +0000
treeherdermozilla-central@8a1379826329 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1477042
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1477042 - Add a pref for counting URIs in private browsing mode. r=mikedeboer Differential Revision: https://phabricator.services.mozilla.com/D2479
browser/modules/BrowserUsageTelemetry.jsm
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -610,32 +610,34 @@ let BrowserUsageTelemetry = {
   /**
    * Adds listeners to a single chrome window.
    */
   _registerWindow(win) {
     win.addEventListener("unload", this);
     win.addEventListener("TabOpen", this, true);
 
     // Don't include URI and domain counts when in private mode.
-    if (PrivateBrowsingUtils.isWindowPrivate(win)) {
+    if (PrivateBrowsingUtils.isWindowPrivate(win) &&
+        !Services.prefs.getBoolPref("browser.engagement.total_uri_count.pbm", false)) {
       return;
     }
     win.gBrowser.tabContainer.addEventListener(TAB_RESTORING_TOPIC, this);
     win.gBrowser.addTabsProgressListener(URICountListener);
   },
 
   /**
    * Removes listeners from a single chrome window.
    */
   _unregisterWindow(win) {
     win.removeEventListener("unload", this);
     win.removeEventListener("TabOpen", this, true);
 
     // Don't include URI and domain counts when in private mode.
-    if (PrivateBrowsingUtils.isWindowPrivate(win.defaultView)) {
+    if (PrivateBrowsingUtils.isWindowPrivate(win) &&
+        !Services.prefs.getBoolPref("browser.engagement.total_uri_count.pbm", false)) {
       return;
     }
     win.defaultView.gBrowser.tabContainer.removeEventListener(TAB_RESTORING_TOPIC, this);
     win.defaultView.gBrowser.removeTabsProgressListener(URICountListener);
   },
 
   /**
    * Updates the tab counts.