Bug 1176391 - Remove privatebrowser-button and context menu click counts from BrowserUITelemetry.jsm. r=Gijs, a=lizzard
authorMike Conley <mconley@mozilla.com>
Fri, 19 Jun 2015 17:47:45 -0400
changeset 253639 4ae44083194b260a5af86679a2bff5cfef34ba04
parent 253638 b085a950c810b86bb054ddd5cf43829a07f45c46
child 253640 281ed9edce03b8f4407c05129510dd612a345738
push id4828
push userryanvm@gmail.com
push dateWed, 24 Jun 2015 20:57:41 +0000
treeherdermozilla-esr52@1e9835314fe8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, lizzard
bugs1176391
milestone39.0
Bug 1176391 - Remove privatebrowser-button and context menu click counts from BrowserUITelemetry.jsm. r=Gijs, a=lizzard
browser/modules/BrowserUITelemetry.jsm
--- a/browser/modules/BrowserUITelemetry.jsm
+++ b/browser/modules/BrowserUITelemetry.jsm
@@ -440,16 +440,22 @@ this.BrowserUITelemetry = {
       this._countMouseUpEvent("click-bookmarks-menu-button", action,
                               aEvent.button);
     }
   },
 
   _checkForBuiltinItem: function(aEvent) {
     let item = aEvent.originalTarget;
 
+    // We don't want to count clicks on the private browsing
+    // button for privacy reasons. See bug 1176391.
+    if (item.id == "privatebrowsing-button") {
+      return;
+    }
+
     // We special-case the bookmarks-menu-button, since we want to
     // monitor more than just clicks on it.
     if (item.id == "bookmarks-menu-button" ||
         getIDBasedOnFirstIDedAncestor(item) == "bookmarks-menu-button") {
       this._bookmarksMenuButtonMouseUp(aEvent);
       return;
     }
 
@@ -650,17 +656,19 @@ this.BrowserUITelemetry = {
   _contextMenuItemWhitelist: new Set([
     "close-without-interaction", // for closing the menu without clicking it.
     "custom-page-item", // The ID we use for page-provided items
     "unknown", // The bucket for stuff with no id.
     // Everything we know of so far (which will exclude add-on items):
     "navigation", "back", "forward", "reload", "stop", "bookmarkpage",
     "spell-no-suggestions", "spell-add-to-dictionary",
     "spell-undo-add-to-dictionary", "openlinkincurrent", "openlinkintab",
-    "openlink", "openlinkprivate", "bookmarklink", "sharelink", "savelink",
+    "openlink",
+    // "openlinkprivate" intentionally omitted for privacy reasons. See bug 1176391.
+    "bookmarklink", "sharelink", "savelink",
     "marklinkMenu", "copyemail", "copylink", "media-play", "media-pause",
     "media-mute", "media-unmute", "media-playbackrate",
     "media-playbackrate-050x", "media-playbackrate-100x",
     "media-playbackrate-150x", "media-playbackrate-200x",
     "media-showcontrols", "media-hidecontrols", "video-showstats",
     "video-hidestats", "video-fullscreen", "leave-dom-fullscreen",
     "reloadimage", "viewimage", "viewvideo", "copyimage-contents", "copyimage",
     "copyvideourl", "copyaudiourl", "saveimage", "shareimage", "sendimage",
@@ -678,16 +686,23 @@ this.BrowserUITelemetry = {
     "bidi-text-direction-toggle", "bidi-page-direction-toggle", "inspect",
     "media-eme-learn-more"
   ]),
 
   _contextMenuInteractions: {},
 
   registerContextMenuInteraction: function(keys, itemID) {
     if (itemID) {
+      if (itemID == "openlinkprivate") {
+        // Don't record anything, not even an other-item count
+        // if the user chose to open in a private window. See
+        // bug 1176391.
+        return;
+      }
+
       if (!this._contextMenuItemWhitelist.has(itemID)) {
         itemID = "other-item";
       }
       keys.push(itemID);
     }
 
     this._countEvent(keys, this._contextMenuInteractions);
   },