Commit 6de6b4fd authored by Katie Dektar's avatar Katie Dektar Committed by Commit Bot

Use new recordBoolean functions in Select-to-Speak and Chromevox.

These simplify recording a boolean value and are more readable.

Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I77165d0f6aaa760c7126d7c29083f139600fcf5d
Reviewed-on: https://chromium-review.googlesource.com/820631
Commit-Queue: Katie D <katie@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523684}
parent e917df9e
...@@ -181,15 +181,8 @@ Background = function() { ...@@ -181,15 +181,8 @@ Background = function() {
// Record a metric with the mode we're in on startup. // Record a metric with the mode we're in on startup.
var useNext = localStorage['useClassic'] != 'true'; var useNext = localStorage['useClassic'] != 'true';
chrome.metricsPrivate.recordValue( chrome.metricsPrivate.recordBoolean(
{ 'Accessibility.CrosChromeVoxNext', useNext);
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);
Notifications.onStartup(); Notifications.onStartup();
}; };
......
...@@ -692,15 +692,9 @@ SelectToSpeak.prototype = { ...@@ -692,15 +692,9 @@ SelectToSpeak.prototype = {
chrome.metricsPrivate.recordSparseValue( chrome.metricsPrivate.recordSparseValue(
'Accessibility.CrosSelectToSpeak.SpeechRate', 'Accessibility.CrosSelectToSpeak.SpeechRate',
this.speechRateToSparceHistogramInt_()); this.speechRateToSparceHistogramInt_());
chrome.metricsPrivate.recordValue( chrome.metricsPrivate.recordBoolean(
{ 'Accessibility.CrosSelectToSpeak.WordHighlighting',
metricName: 'Accessibility.CrosSelectToSpeak.WordHighlighting', this.wordHighlight_);
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.
},
this.wordHighlight_ ? 1 : 0);
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment