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

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

Issue 1548283003: Add P2 UMA metrics for Media Router user actions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 // 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 function closeDialog() { 130 function closeDialog() {
131 chrome.send('closeDialog'); 131 chrome.send('closeDialog');
132 } 132 }
133 133
134 /** 134 /**
135 * Closes the given route. 135 * Closes the given route.
136 * 136 *
137 * @param {!media_router.Route} route 137 * @param {!media_router.Route} route
138 */ 138 */
139 function closeRoute(route) { 139 function closeRoute(route) {
140 chrome.send('closeRoute', [{routeId: route.id}]); 140 chrome.send('closeRoute', [{routeId: route.id, isLocal: route.isLocal}]);
141 } 141 }
142 142
143 /** 143 /**
144 * Indicates that the initial data has been received. 144 * Indicates that the initial data has been received.
145 */ 145 */
146 function onInitialDataReceived() { 146 function onInitialDataReceived() {
147 chrome.send('onInitialDataReceived'); 147 chrome.send('onInitialDataReceived');
148 } 148 }
149 149
150 /** 150 /**
151 * Reports the index of the selected sink.
152 *
153 * @param {number} sinkIndex
154 */
155 function reportClickedSinkIndex(sinkIndex) {
156 chrome.send('reportClickedSinkIndex', [sinkIndex]);
157 }
158
159 /**
160 * Reports the cast mode that the user selected.
161 *
162 * @param {number} castModeType
163 */
164 function reportSelectedCastMode(castModeType) {
165 chrome.send('reportSelectedCastMode', [castModeType]);
166 }
167
168 /**
151 * Reports the current number of sinks. 169 * Reports the current number of sinks.
152 * 170 *
153 * @param {number} sinkCount 171 * @param {number} sinkCount
154 */ 172 */
155 function reportSinkCount(sinkCount) { 173 function reportSinkCount(sinkCount) {
156 chrome.send('reportSinkCount', [sinkCount]); 174 chrome.send('reportSinkCount', [sinkCount]);
157 } 175 }
158 176
159 /** 177 /**
160 * Requests data to initialize the WebUI with. 178 * Requests data to initialize the WebUI with.
(...skipping 13 matching lines...) Expand all
174 function requestRoute(sinkId, selectedCastMode) { 192 function requestRoute(sinkId, selectedCastMode) {
175 chrome.send('requestRoute', 193 chrome.send('requestRoute',
176 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]); 194 [{sinkId: sinkId, selectedCastMode: selectedCastMode}]);
177 } 195 }
178 196
179 return { 197 return {
180 actOnIssue: actOnIssue, 198 actOnIssue: actOnIssue,
181 closeDialog: closeDialog, 199 closeDialog: closeDialog,
182 closeRoute: closeRoute, 200 closeRoute: closeRoute,
183 onInitialDataReceived: onInitialDataReceived, 201 onInitialDataReceived: onInitialDataReceived,
202 reportClickedSinkIndex: reportClickedSinkIndex,
203 reportSelectedCastMode: reportSelectedCastMode,
184 reportSinkCount: reportSinkCount, 204 reportSinkCount: reportSinkCount,
185 requestInitialData: requestInitialData, 205 requestInitialData: requestInitialData,
186 requestRoute: requestRoute, 206 requestRoute: requestRoute,
187 }; 207 };
188 }); 208 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698