Bug 1412358 - Add telemetry probes for actions on accessibility indicator button and accessibility privacy preference checkbox. r=jimm, a=ritu
authorYura Zenevich <yura.zenevich@gmail.com>
Fri, 27 Oct 2017 14:47:36 -0400
changeset 432918 d57f1c698b4e2930c64d4beeceb294b0184aae31
parent 432917 05e050d6c86867f19590b72a6131713df81044aa
child 432919 a81ec6b0546245e736848656799b242eddd0622b
push id8110
push userryanvm@gmail.com
push dateThu, 02 Nov 2017 02:13:00 +0000
treeherdermozilla-beta@eb82b9fadf9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, ritu
bugs1412358
milestone57.0
Bug 1412358 - Add telemetry probes for actions on accessibility indicator button and accessibility privacy preference checkbox. r=jimm, a=ritu MozReview-Commit-ID: 4xXbf5UwnWK
browser/base/content/browser.js
browser/components/preferences/in-content/privacy.js
toolkit/components/telemetry/Scalars.yaml
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -8127,16 +8127,17 @@ const gAccessibilityServiceIndicator = {
   },
 
   handleEvent({ key, type }) {
     if ((type === "keypress" && [" ", "Enter"].includes(key)) ||
          type === "click") {
       let a11yServicesSupportURL =
         Services.urlFormatter.formatURLPref("accessibility.support.url");
       gBrowser.selectedTab = gBrowser.addTab(a11yServicesSupportURL);
+      Services.telemetry.scalarSet("a11y.indicator_acted_on", true);
     }
   },
 
   uninit() {
     gPrefService.removeObserver("accessibility.indicator.enabled", this);
     Services.obs.removeObserver(this, "a11y-init-or-shutdown");
     this.update();
   }
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -1645,15 +1645,16 @@ var gPrivacyPane = {
     document.getElementById("a11yLearnMoreLink")
       .setAttribute("href", a11yLearnMoreLink);
   },
 
   updateA11yPrefs(checked) {
     let buttonIndex = confirmRestartPrompt(checked, 0, true, false);
     if (buttonIndex == CONFIRM_RESTART_PROMPT_RESTART_NOW) {
       Services.prefs.setIntPref("accessibility.force_disabled", checked ? 1 : 0);
+      Services.telemetry.scalarSet("preferences.prevent_accessibility_services", true);
       Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
     }
 
     // Revert the checkbox in case we didn't quit
     document.getElementById("a11yPrivacyCheckbox").checked = !checked;
   }
 };
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -14,16 +14,30 @@ a11y:
     notification_emails:
       - dbolter@mozilla.com
     record_in_processes:
       - 'main'
     release_channel_collection: opt-out
     keyed: false
     cpp_guard: 'ACCESSIBILITY'
 
+  indicator_acted_on:
+    bug_numbers:
+      - 1412358
+    description: >
+      Recorded on click or SPACE/ENTER keypress event. Boolean stating if the
+      accessibility indicactor button was acted on.
+    expires: "62"
+    kind: boolean
+    notification_emails:
+      - yzenevich@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
+
 # The following section contains the aushelper system add-on scalars.
 aushelper:
   websense_reg_version:
     bug_numbers:
       - 1305847
     description: The Websense version from the Windows registry.
     expires: "60"
     kind: string
@@ -540,16 +554,30 @@ preferences:
     expires: "62"
     kind: uint
     keyed: true
     notification_emails:
       - chsiang@mozilla.com
     release_channel_collection: opt-in
     record_in_processes:
       - main
+  prevent_accessibility_services:
+    bug_numbers:
+      - 1412358
+    description: >
+      Recorded on command event. Boolean stating if the preference checkbox for
+      preventing accessibility from accessing the browser (Privacy & Security)
+      was checked.
+    expires: "62"
+    kind: boolean
+    notification_emails:
+      - yzenevich@mozilla.com
+    release_channel_collection: opt-out
+    record_in_processes:
+      - 'main'
 
 # The following section contains WebRTC nICEr scalars
 # For more info on ICE, see https://tools.ietf.org/html/rfc5245
 # For more info on STUN, see https://tools.ietf.org/html/rfc5389
 # For more info on TURN, see https://tools.ietf.org/html/rfc5766
 webrtc.nicer:
   stun_retransmits:
     bug_numbers: