Skip to content

Commit

Permalink
Use new recordBoolean functions in Select-to-Speak and Chromevox.
Browse files Browse the repository at this point in the history
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: Ilya Sherman <isherman@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523684}
  • Loading branch information
dektar authored and Commit Bot committed Dec 13, 2017
1 parent e917df9 commit 6de6b4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,8 @@ Background = function() {

// Record a metric with the mode we're in on startup.
var useNext = localStorage['useClassic'] != 'true';
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);
chrome.metricsPrivate.recordBoolean(
'Accessibility.CrosChromeVoxNext', useNext);

Notifications.onStartup();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,15 +692,9 @@ SelectToSpeak.prototype = {
chrome.metricsPrivate.recordSparseValue(
'Accessibility.CrosSelectToSpeak.SpeechRate',
this.speechRateToSparceHistogramInt_());
chrome.metricsPrivate.recordValue(
{
metricName: 'Accessibility.CrosSelectToSpeak.WordHighlighting',
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);
chrome.metricsPrivate.recordBoolean(
'Accessibility.CrosSelectToSpeak.WordHighlighting',
this.wordHighlight_);
},

/**
Expand Down

0 comments on commit 6de6b4f

Please sign in to comment.