Skip to content
Snippets Groups Projects
Commit 6de83617 authored by Benjamin Smedberg's avatar Benjamin Smedberg
Browse files

Bug 902075 - Add telemetry for plugin click-to-activate doorhanger UI, r=vladan

parent fd370d9d
No related branches found
No related tags found
No related merge requests found
......@@ -623,6 +623,8 @@ var gPluginHandler = {
_clickToPlayNotificationEventCallback: function PH_ctpEventCallback(event) {
if (event == "showing") {
gPluginHandler._makeCenterActions(this);
Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_SHOWN")
.add(!this.options.primaryPlugin);
}
else if (event == "dismissed") {
// Once the popup is dismissed, clicking the icon should show the full
......@@ -703,6 +705,14 @@ var gPluginHandler = {
});
notification.options.centerActions = centerActions;
// Histograms always start at 0, even though our data starts at 1
let histogramCount = centerActions.length - 1;
if (histogramCount > 4) {
histogramCount = 4;
}
Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_PLUGIN_COUNT")
.add(histogramCount);
},
/**
......@@ -714,12 +724,15 @@ var gPluginHandler = {
let permission;
let expireType;
let expireTime;
let histogram =
Services.telemetry.getHistogramById("PLUGINS_NOTIFICATION_USER_ACTION");
switch (aNewState) {
case "allownow":
permission = Ci.nsIPermissionManager.ALLOW_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_SESSION;
expireTime = Date.now() + Services.prefs.getIntPref(this.PREF_SESSION_PERSIST_MINUTES) * 60 * 1000;
histogram.add(0);
break;
case "allowalways":
......@@ -727,12 +740,14 @@ var gPluginHandler = {
expireType = Ci.nsIPermissionManager.EXPIRE_TIME;
expireTime = Date.now() +
Services.prefs.getIntPref(this.PREF_PERSISTENT_DAYS) * 24 * 60 * 60 * 1000;
histogram.add(1);
break;
case "block":
permission = Ci.nsIPermissionManager.PROMPT_ACTION;
expireType = Ci.nsIPermissionManager.EXPIRE_NEVER;
expireTime = 0;
histogram.add(2);
break;
// In case a plugin has already been allowed in another tab, the "continue allowing" button
......
......@@ -3201,6 +3201,20 @@
"n_buckets": 50,
"description": "Time spent to display first page in PDF Viewer (ms)"
},
"PLUGINS_NOTIFICATION_SHOWN": {
"kind": "boolean",
"description": "The number of times the click-to-activate notification was shown: false: shown by in-content activation true: shown by location bar activation"
},
"PLUGINS_NOTIFICATION_PLUGIN_COUNT": {
"kind": "enumerated",
"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"
},
"POPUP_NOTIFICATION_MAINACTION_TRIGGERED_MS": {
"kind": "linear",
"low": 25,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment