Bug 1477042 - Add a pref for counting URIs in private browsing mode. r=mikedeboer a=ritu DEVEDITION_62_0b13_BUILD1 DEVEDITION_62_0b13_RELEASE FENNEC_62_0b13_BUILD1 FENNEC_62_0b13_RELEASE FIREFOX_62_0b13_BUILD1 FIREFOX_62_0b13_RELEASE
authorMichael Kaply <mozilla@kaply.com>
Fri, 27 Jul 2018 22:45:29 +0000
changeset 478162 dd92dec96711e60a8c6a49ebe584fa23a453a292
parent 478161 2942197b25d1aa06e25f7a772a4ab910c62db212
child 478163 83498965f3440f450f4e62a4a8acdd12a725b50c
push id9556
push userarchaeopteryx@coole-files.de
push dateMon, 30 Jul 2018 18:04:07 +0000
treeherdermozilla-beta@dd92dec96711 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer, ritu
bugs1477042
milestone62.0
Bug 1477042 - Add a pref for counting URIs in private browsing mode. r=mikedeboer a=ritu 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.