Chromium Code Reviews| 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 dc2fdece34394575665044b27b4eea25786baba3..edadedcd1139ef641836bc8ec4cae909af53a8e8 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js |
| @@ -225,6 +225,14 @@ Background.prototype = { |
| getMode: function() { |
| 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); |
|
David Tseng
2016/11/15 06:20:39
Do we really want this called every time getMode g
dmazzoni
2016/11/15 17:48:47
Oops, no. Moved to the Background constructor.
|
| + |
| var target; |
| if (!this.getCurrentRange()) { |
| chrome.automation.getFocus(function(focus) { |
| @@ -349,6 +357,12 @@ Background.prototype = { |
| else |
| useNext = localStorage['useNext'] !== 'true'; |
| + if (useNext) { |
| + chrome.metricsPrivate.recordUserAction('ChromeVox.ToggleNextOn'); |
| + } else { |
| + chrome.metricsPrivate.recordUserAction('ChromeVox.ToggleNextOff'); |
| + } |
| + |
| localStorage['useNext'] = useNext; |
| if (useNext) |
| this.setCurrentRangeToFocus_(); |