Bug 1477042 - Add a pref for counting URIs in private browsing mode. r=mikedeboer, a=RyanVM
authorMichael Kaply <mozilla@kaply.com>
Fri, 27 Jul 2018 22:45:29 +0000
changeset 473820 d22d9ccbec14
parent 473819 24dd1a9e2c2c
child 473821 dad476171a76
push id1750
push userryanvm@gmail.com
push dateMon, 06 Aug 2018 15:17:36 +0000
treeherdermozilla-release@d22d9ccbec14 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, RyanVM
bugs1477042
milestone61.0.2
Bug 1477042 - Add a pref for counting URIs in private browsing mode. r=mikedeboer, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D2479
browser/modules/BrowserUsageTelemetry.jsm
--- a/browser/modules/BrowserUsageTelemetry.jsm
+++ b/browser/modules/BrowserUsageTelemetry.jsm
@@ -611,32 +611,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.defaultView) &&
+        !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.