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

Side by Side Diff: chrome/browser/resources/hotword/metrics.js

Issue 2346683004: Update chrome.metricsPrivate externs and make closure fixes (Closed)
Patch Set: fix file manager test Created 4 years, 3 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.define('hotword.metrics', function() { 5 cr.define('hotword.metrics', function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * Helper function to record enum values in UMA. 9 * Helper function to record enum values in UMA.
10 * @param {!string} name 10 * @param {!string} name
11 * @param {!number} value 11 * @param {!number} value
12 * @param {!number} maxValue 12 * @param {!number} maxValue
13 */ 13 */
14 function recordEnum(name, value, maxValue) { 14 function recordEnum(name, value, maxValue) {
15 var metricDesc = { 15 var metricDesc = {
16 'metricName': name, 16 'metricName': name,
17 'type': 'histogram-linear', 17 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR,
18 'min': 1, 18 'min': 1,
19 'max': maxValue, 19 'max': maxValue,
20 'buckets': maxValue + 1 20 'buckets': maxValue + 1
21 }; 21 };
22 chrome.metricsPrivate.recordValue(metricDesc, value); 22 chrome.metricsPrivate.recordValue(metricDesc, value);
23 } 23 }
24 24
25 return { 25 return {
26 recordEnum: recordEnum 26 recordEnum: recordEnum
27 }; 27 };
28 }); 28 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | chrome/test/data/extensions/api_test/metrics/test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698