Bug 932854 - Add telemetry for showing the plugin infobar and its two buttons. r=jaws, a=lsblakk
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 19 Nov 2013 08:17:03 -0500
changeset 161368 97325de07f0086c247dcbacceb1527567f9bc242
parent 161367 f3a99bcfe01b6205510c4a87e08dd9e88b6c899e
child 161369 f1f0c01ef96e9ca48b1110f8dcdb2d285913e7a9
push id4624
push userryanvm@gmail.com
push dateThu, 21 Nov 2013 13:30:49 +0000
treeherdermozilla-aurora@f1f0c01ef96e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws, lsblakk
bugs932854
milestone27.0a2
Bug 932854 - Add telemetry for showing the plugin infobar and its two buttons. r=jaws, a=lsblakk
browser/base/content/browser-plugins.js
toolkit/components/telemetry/Histograms.json
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -955,16 +955,19 @@ var gPluginHandler = {
     //     vulnerable. Show the nonvulnerable multi-UI.
     function showNotification() {
       let n = notificationBox.getNotificationWithValue("plugin-hidden");
       if (n) {
         // If something is already shown, just keep it
         return;
       }
 
+      Services.telemetry.getHistogramById("PLUGINS_INFOBAR_SHOWN").
+        add(true);
+
       let message;
       // Icons set directly cannot be manipulated using moz-image-region, so
       // we use CSS classes instead.
       let host = gPluginHandler._getHostFromPrincipal(aBrowser.contentDocument.nodePrincipal);
       let brand = document.getElementById("bundle_brand").getString("brandShortName");
 
       if (actions.size == 1) {
         let pluginInfo = [...actions.values()][0];
@@ -999,25 +1002,31 @@ var gPluginHandler = {
       }
 
       // These strings are temporary no-string-change for branch uplift
       let buttons = [
         {
           label: gNavigatorBundle.getString("pluginBlockNow.label"),
           accessKey: gNavigatorBundle.getString("pluginBlockNow.accesskey"),
           callback: function() {
+            Services.telemetry.getHistogramById("PLUGINS_INFOBAR_BLOCK").
+              add(true);
+
             Services.perms.addFromPrincipal(aBrowser.contentDocument.nodePrincipal,
                                             "plugin-hidden-notification",
                                             Services.perms.DENY_ACTION);
           }
         },
         {
           label: gNavigatorBundle.getString("offlineApps.allow"),
           accessKey: gNavigatorBundle.getString("offlineApps.allowAccessKey"),
           callback: function() {
+            Services.telemetry.getHistogramById("PLUGINS_INFOBAR_ALLOW").
+              add(true);
+
             let curNotification =
               PopupNotifications.getNotification("click-to-play-plugins",
                                                  aBrowser);
             if (curNotification) {
               curNotification.reshow();
             }
           }
         }
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3543,16 +3543,28 @@
     "n_values": 5,
     "description": "The number of plugins present in the click-to-activate notification, minus one (1, 2, 3, 4, more than 4)"
   },
   "PLUGINS_NOTIFICATION_USER_ACTION": {
     "kind": "enumerated",
     "n_values": 3,
     "description": "User actions taken in the plugin notification: 0: allownow 1: allowalways 2: block"
   },
+  "PLUGINS_INFOBAR_SHOWN": {
+    "kind": "boolean",
+    "description": "Count of when the hidden-plugin infobar was displayed."
+  },
+  "PLUGINS_INFOBAR_BLOCK": {
+    "kind": "boolean",
+    "description": "Count the number of times the user clicked 'block' on the hidden-plugin infobar."
+  },
+  "PLUGINS_INFOBAR_ALLOW": {
+    "kind": "boolean",
+    "description": "Count the number of times the user clicked 'allow' on the hidden-plugin infobar."
+  },
   "POPUP_NOTIFICATION_MAINACTION_TRIGGERED_MS": {
     "kind": "linear",
     "low": 25,
     "high": "80 * 25",
     "n_buckets": "80 + 1",
     "description": "The time (in milliseconds) after showing a PopupNotification that the mainAction was first triggered"
   },
   "DEVTOOLS_DEBUGGER_RDP_LOCAL_RELOAD_MS": {