| OLD | NEW |
| 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. |
| 11 var container = null; | 11 var container = null; |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * Handles timeout of previous create route attempt. | 14 * Handles timeout of previous create route attempt. |
| 15 */ | 15 */ |
| 16 function onNotifyRouteCreationTimeout() { | 16 function onNotifyRouteCreationTimeout() { |
| 17 container.onNotifyRouteCreationTimeout(); | 17 container.onNotifyRouteCreationTimeout(); |
| 18 } | 18 } |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * Handles response of previous create route attempt. | 21 * Handles response of previous create route attempt. |
| 22 * | 22 * |
| 23 * @param {string} sinkId The ID of the sink to which the Media Route was | 23 * @param {string} sinkId The ID of the sink to which the Media Route was |
| 24 * creating a route. | 24 * creating a route. |
| 25 * @param {?media_router.Route} route The newly create route to the sink | 25 * @param {string} routeId The ID of the newly created route that corresponds |
| 26 * if route creation succeeded; null otherwise | 26 * to the sink if route creation succeeded; empty otherwise. |
| 27 */ | 27 */ |
| 28 function onCreateRouteResponseReceived(sinkId, route) { | 28 function onCreateRouteResponseReceived(sinkId, routeId) { |
| 29 container.onCreateRouteResponseReceived(sinkId, route); | 29 container.onCreateRouteResponseReceived(sinkId, routeId); |
| 30 } | 30 } |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Sets the cast mode list. | 33 * Sets the cast mode list. |
| 34 * | 34 * |
| 35 * @param {!Array<!media_router.CastMode>} castModeList | 35 * @param {!Array<!media_router.CastMode>} castModeList |
| 36 */ | 36 */ |
| 37 function setCastModeList(castModeList) { | 37 function setCastModeList(castModeList) { |
| 38 container.castModeList = castModeList; | 38 container.castModeList = castModeList; |
| 39 } | 39 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 /** | 208 /** |
| 209 * Reports the navigation to the specified view. | 209 * Reports the navigation to the specified view. |
| 210 * | 210 * |
| 211 * @param {string} view | 211 * @param {string} view |
| 212 */ | 212 */ |
| 213 function reportNavigateToView(view) { | 213 function reportNavigateToView(view) { |
| 214 chrome.send('reportNavigateToView', [view]); | 214 chrome.send('reportNavigateToView', [view]); |
| 215 } | 215 } |
| 216 | 216 |
| 217 /** | 217 /** |
| 218 * Reports whether or not a route was created successfully. |
| 219 * |
| 220 * @param {boolean} success |
| 221 */ |
| 222 function reportRouteCreation(success) { |
| 223 chrome.send('reportRouteCreation', [success]); |
| 224 } |
| 225 |
| 226 /** |
| 218 * Reports the cast mode that the user selected. | 227 * Reports the cast mode that the user selected. |
| 219 * | 228 * |
| 220 * @param {number} castModeType | 229 * @param {number} castModeType |
| 221 */ | 230 */ |
| 222 function reportSelectedCastMode(castModeType) { | 231 function reportSelectedCastMode(castModeType) { |
| 223 chrome.send('reportSelectedCastMode', [castModeType]); | 232 chrome.send('reportSelectedCastMode', [castModeType]); |
| 224 } | 233 } |
| 225 | 234 |
| 226 /** | 235 /** |
| 227 * Reports the current number of sinks. | 236 * Reports the current number of sinks. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 actOnIssue: actOnIssue, | 286 actOnIssue: actOnIssue, |
| 278 closeDialog: closeDialog, | 287 closeDialog: closeDialog, |
| 279 closeRoute: closeRoute, | 288 closeRoute: closeRoute, |
| 280 joinRoute: joinRoute, | 289 joinRoute: joinRoute, |
| 281 onInitialDataReceived: onInitialDataReceived, | 290 onInitialDataReceived: onInitialDataReceived, |
| 282 reportClickedSinkIndex: reportClickedSinkIndex, | 291 reportClickedSinkIndex: reportClickedSinkIndex, |
| 283 reportInitialAction: reportInitialAction, | 292 reportInitialAction: reportInitialAction, |
| 284 reportInitialState: reportInitialState, | 293 reportInitialState: reportInitialState, |
| 285 reportNavigateToView: reportNavigateToView, | 294 reportNavigateToView: reportNavigateToView, |
| 286 reportSelectedCastMode: reportSelectedCastMode, | 295 reportSelectedCastMode: reportSelectedCastMode, |
| 296 reportRouteCreation: reportRouteCreation, |
| 287 reportSinkCount: reportSinkCount, | 297 reportSinkCount: reportSinkCount, |
| 288 reportTimeToClickSink: reportTimeToClickSink, | 298 reportTimeToClickSink: reportTimeToClickSink, |
| 289 reportTimeToInitialActionClose: reportTimeToInitialActionClose, | 299 reportTimeToInitialActionClose: reportTimeToInitialActionClose, |
| 290 requestInitialData: requestInitialData, | 300 requestInitialData: requestInitialData, |
| 291 requestRoute: requestRoute, | 301 requestRoute: requestRoute, |
| 292 }; | 302 }; |
| 293 }); | 303 }); |
| OLD | NEW |