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. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 * sinksAndIdentity - list of sinks to be displayed and user identity. | 103 * sinksAndIdentity - list of sinks to be displayed and user identity. |
104 * routes - list of routes that are associated with the sinks. | 104 * routes - list of routes that are associated with the sinks. |
105 * castModes - list of available cast modes. | 105 * castModes - list of available cast modes. |
106 */ | 106 */ |
107 function setInitialData(data) { | 107 function setInitialData(data) { |
108 container.deviceMissingUrl = data['deviceMissingUrl']; | 108 container.deviceMissingUrl = data['deviceMissingUrl']; |
109 container.castModeList = data['castModes']; | 109 container.castModeList = data['castModes']; |
110 this.setSinkListAndIdentity(data['sinksAndIdentity']); | 110 this.setSinkListAndIdentity(data['sinksAndIdentity']); |
111 container.routeList = data['routes']; | 111 container.routeList = data['routes']; |
112 container.maybeShowRouteDetailsOnOpen(); | 112 container.maybeShowRouteDetailsOnOpen(); |
| 113 if (data['initialCastMode'] !== undefined) |
| 114 container.setInitialCastMode(data['initialCastMode']); |
113 media_router.browserApi.onInitialDataReceived(); | 115 media_router.browserApi.onInitialDataReceived(); |
114 } | 116 } |
115 | 117 |
116 /** | 118 /** |
117 * Sets current issue to |issue|, or clears the current issue if |issue| is | 119 * Sets current issue to |issue|, or clears the current issue if |issue| is |
118 * null. | 120 * null. |
119 * | 121 * |
120 * @param {?media_router.Issue} issue | 122 * @param {?media_router.Issue} issue |
121 */ | 123 */ |
122 function setIssue(issue) { | 124 function setIssue(issue) { |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 reportRouteCreationOutcome: reportRouteCreationOutcome, | 417 reportRouteCreationOutcome: reportRouteCreationOutcome, |
416 reportSelectedCastMode: reportSelectedCastMode, | 418 reportSelectedCastMode: reportSelectedCastMode, |
417 reportSinkCount: reportSinkCount, | 419 reportSinkCount: reportSinkCount, |
418 reportTimeToClickSink: reportTimeToClickSink, | 420 reportTimeToClickSink: reportTimeToClickSink, |
419 reportTimeToInitialActionClose: reportTimeToInitialActionClose, | 421 reportTimeToInitialActionClose: reportTimeToInitialActionClose, |
420 requestInitialData: requestInitialData, | 422 requestInitialData: requestInitialData, |
421 requestRoute: requestRoute, | 423 requestRoute: requestRoute, |
422 searchSinksAndCreateRoute: searchSinksAndCreateRoute, | 424 searchSinksAndCreateRoute: searchSinksAndCreateRoute, |
423 }; | 425 }; |
424 }); | 426 }); |
OLD | NEW |