Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2416)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js

Issue 2495373005: Record ChromeVox metrics (Closed)
Patch Set: Reword Accessibility.CrosChromeVoxNext description Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index b120e2abcbfc4705f984b0665212a5f11b26d59e..79e09ec183f0957a3bbd7b04f244640bfe2acbc8 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -175,6 +175,16 @@ Background = function() {
* @private
*/
this.focusRecoveryMap_ = new WeakMap();
+
+ // Record a metric with the mode we're in on startup.
+ var useNext = localStorage['useNext'] !== 'false';
+ chrome.metricsPrivate.recordValue(
+ { metricName: 'Accessibility.CrosChromeVoxNext',
+ type: chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR,
+ min: 1, // According to histogram.h, this should be 1 for enums.
+ max: 2, // Maximum should be exclusive.
+ buckets: 3 }, // Number of buckets: 0, 1 and overflowing 2.
+ useNext ? 1 : 0);
};
/**
@@ -349,6 +359,14 @@ Background.prototype = {
else
useNext = localStorage['useNext'] !== 'true';
+ if (useNext) {
+ chrome.metricsPrivate.recordUserAction(
+ 'Accessibility.ChromeVox.ToggleNextOn');
+ } else {
+ chrome.metricsPrivate.recordUserAction(
+ 'Accessibility.ChromeVox.ToggleNextOff');
+ }
+
localStorage['useNext'] = useNext;
if (useNext)
this.setCurrentRangeToFocus_();
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698