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

Side by Side Diff: components/chrome_apps/webstore_widget/app/main.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 //<include src="../../../../ui/webui/resources/js/cr.js"> 5 //<include src="../../../../ui/webui/resources/js/cr.js">
6 //<include src="../../../../ui/webui/resources/js/load_time_data.js"> 6 //<include src="../../../../ui/webui/resources/js/load_time_data.js">
7 //<include src="../../../../ui/webui/resources/js/i18n_template_no_process.js"> 7 //<include src="../../../../ui/webui/resources/js/i18n_template_no_process.js">
8 //<include src="../../../../ui/webui/resources/js/cr/event_target.js"> 8 //<include src="../../../../ui/webui/resources/js/cr/event_target.js">
9 //<include src="../../../../ui/webui/resources/js/cr/ui/dialogs.js"> 9 //<include src="../../../../ui/webui/resources/js/cr/ui/dialogs.js">
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 /** 76 /**
77 * @param {string} enumName 77 * @param {string} enumName
78 * @param {number} value 78 * @param {number} value
79 * @param {number} enumSize 79 * @param {number} enumSize
80 */ 80 */
81 recordEnum: function(enumName, value, enumSize) { 81 recordEnum: function(enumName, value, enumSize) {
82 var index = (value >= 0 && value < enumSize) ? value : enumSize; 82 var index = (value >= 0 && value < enumSize) ? value : enumSize;
83 chrome.metricsPrivate.recordValue({ 83 chrome.metricsPrivate.recordValue({
84 'metricName': 'WebstoreWidgetApp.' + enumName, 84 'metricName': 'WebstoreWidgetApp.' + enumName,
85 'type': 'histogram-linear', 85 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR,
86 'min': 1, 86 'min': 1,
87 'max': enumSize, 87 'max': enumSize,
88 'buckets': enumSize + 1 88 'buckets': enumSize + 1
89 }, index); 89 }, index);
90 }, 90 },
91 91
92 /** @param {string} actionName */ 92 /** @param {string} actionName */
93 recordUserAction: function(actionName) { 93 recordUserAction: function(actionName) {
94 chrome.metricsPrivate.recordUserAction( 94 chrome.metricsPrivate.recordUserAction(
95 'WebstoreWidgetApp.' + actionName); 95 'WebstoreWidgetApp.' + actionName);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 var result = widgetContainer.finalizeAndGetResult(); 235 var result = widgetContainer.finalizeAndGetResult();
236 showWidgetResult(result.result); 236 showWidgetResult(result.result);
237 }) 237 })
238 /** @param {*} error */ 238 /** @param {*} error */
239 .catch(function(error) { 239 .catch(function(error) {
240 showWidgetResult(CWSWidgetContainer.Result.FAILED); 240 showWidgetResult(CWSWidgetContainer.Result.FAILED);
241 }); 241 });
242 }); 242 });
243 }); 243 });
244 })(); 244 })();
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/metrics/test.js ('k') | remoting/webapp/base/js/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698