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

Side by Side Diff: chrome/browser/resources/media_router/media_router_ui_interface.js

Issue 1423683002: [Media Router] Add P1 UMA metrics for Media Router. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix JS. Created 5 years, 1 month 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 // API invoked by the browser MediaRouterWebUIMessageHandler to communicate 5 // API invoked by the browser MediaRouterWebUIMessageHandler to communicate
6 // with this UI. 6 // with this UI.
7 cr.define('media_router.ui', function() { 7 cr.define('media_router.ui', function() {
8 'use strict'; 8 'use strict';
9 9
10 // The media-router-container element. 10 // The media-router-container element.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 /** 137 /**
138 * Closes the given route. 138 * Closes the given route.
139 * 139 *
140 * @param {!media_router.Route} route 140 * @param {!media_router.Route} route
141 */ 141 */
142 function closeRoute(route) { 142 function closeRoute(route) {
143 chrome.send('closeRoute', [{routeId: route.id}]); 143 chrome.send('closeRoute', [{routeId: route.id}]);
144 } 144 }
145 145
146 /** 146 /**
147 * Reports the current number of sinks.
148 *
149 * @param {number} sinkCount
150 */
151 function reportSinkCount(sinkCount) {
152 chrome.send('reportSinkCount', [sinkCount]);
153 }
154
155 /**
147 * Requests data to initialize the WebUI with. 156 * Requests data to initialize the WebUI with.
148 * The data will be returned via media_router.ui.setInitialData. 157 * The data will be returned via media_router.ui.setInitialData.
149 */ 158 */
150 function requestInitialData() { 159 function requestInitialData() {
151 chrome.send('requestInitialData'); 160 chrome.send('requestInitialData');
152 } 161 }
153 162
154 /** 163 /**
155 * Requests that a media route be started with the given sink. 164 * Requests that a media route be started with the given sink.
156 * 165 *
157 * @param {string} sinkId The sink ID. 166 * @param {string} sinkId The sink ID.
158 * @param {number} selectedCastMode The value of the cast mode the user 167 * @param {number} selectedCastMode The value of the cast mode the user
159 * selected. 168 * selected.
160 */ 169 */
161 function requestRoute(sinkId, selectedCastMode) { 170 function requestRoute(sinkId, selectedCastMode) {
162 chrome.send('requestRoute', 171 chrome.send('requestRoute',
163 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); 172 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]);
164 } 173 }
165 174
166 return { 175 return {
167 actOnIssue: actOnIssue, 176 actOnIssue: actOnIssue,
168 closeDialog: closeDialog, 177 closeDialog: closeDialog,
169 closeRoute: closeRoute, 178 closeRoute: closeRoute,
179 reportSinkCount: reportSinkCount,
170 requestInitialData: requestInitialData, 180 requestInitialData: requestInitialData,
171 requestRoute: requestRoute, 181 requestRoute: requestRoute,
172 }; 182 };
173 }); 183 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698