| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 /** | 89 /** |
| 90 * Populates the WebUI with data obtained from Media Router. | 90 * Populates the WebUI with data obtained from Media Router. |
| 91 * | 91 * |
| 92 * @param {{deviceMissingUrl: string, | 92 * @param {{deviceMissingUrl: string, |
| 93 * sinksAndIdentity: { | 93 * sinksAndIdentity: { |
| 94 * sinks: !Array<!media_router.Sink>, | 94 * sinks: !Array<!media_router.Sink>, |
| 95 * showEmail: boolean, | 95 * showEmail: boolean, |
| 96 * userEmail: string, | 96 * userEmail: string, |
| 97 * showDomain: boolean | 97 * showDomain: boolean |
| 98 * }, | 98 * }, |
| 99 * routes: !Array<!media_router.Route>, | |
| 100 * castModes: !Array<!media_router.CastMode>}} data | 99 * castModes: !Array<!media_router.CastMode>}} data |
| 101 * Parameters in data: | 100 * Parameters in data: |
| 102 * deviceMissingUrl - url to be opened on "Device missing?" clicked. | 101 * deviceMissingUrl - url to be opened on "Device missing?" clicked. |
| 103 * sinksAndIdentity - list of sinks to be displayed and user identity. | 102 * sinksAndIdentity - list of sinks to be displayed and user identity. |
| 104 * routes - list of routes that are associated with the sinks. | |
| 105 * castModes - list of available cast modes. | 103 * castModes - list of available cast modes. |
| 106 */ | 104 */ |
| 107 function setInitialData(data) { | 105 function setInitialData(data) { |
| 108 container.deviceMissingUrl = data['deviceMissingUrl']; | 106 container.deviceMissingUrl = data['deviceMissingUrl']; |
| 109 container.castModeList = data['castModes']; | 107 container.castModeList = data['castModes']; |
| 110 this.setSinkListAndIdentity(data['sinksAndIdentity']); | 108 this.setSinkListAndIdentity(data['sinksAndIdentity']); |
| 111 container.routeList = data['routes']; | |
| 112 container.maybeShowRouteDetailsOnOpen(); | |
| 113 media_router.browserApi.onInitialDataReceived(); | 109 media_router.browserApi.onInitialDataReceived(); |
| 114 } | 110 } |
| 115 | 111 |
| 116 /** | 112 /** |
| 117 * Sets current issue to |issue|, or clears the current issue if |issue| is | 113 * Sets current issue to |issue|, or clears the current issue if |issue| is |
| 118 * null. | 114 * null. |
| 119 * | 115 * |
| 120 * @param {?media_router.Issue} issue | 116 * @param {?media_router.Issue} issue |
| 121 */ | 117 */ |
| 122 function setIssue(issue) { | 118 function setIssue(issue) { |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 reportRouteCreationOutcome: reportRouteCreationOutcome, | 411 reportRouteCreationOutcome: reportRouteCreationOutcome, |
| 416 reportSelectedCastMode: reportSelectedCastMode, | 412 reportSelectedCastMode: reportSelectedCastMode, |
| 417 reportSinkCount: reportSinkCount, | 413 reportSinkCount: reportSinkCount, |
| 418 reportTimeToClickSink: reportTimeToClickSink, | 414 reportTimeToClickSink: reportTimeToClickSink, |
| 419 reportTimeToInitialActionClose: reportTimeToInitialActionClose, | 415 reportTimeToInitialActionClose: reportTimeToInitialActionClose, |
| 420 requestInitialData: requestInitialData, | 416 requestInitialData: requestInitialData, |
| 421 requestRoute: requestRoute, | 417 requestRoute: requestRoute, |
| 422 searchSinksAndCreateRoute: searchSinksAndCreateRoute, | 418 searchSinksAndCreateRoute: searchSinksAndCreateRoute, |
| 423 }; | 419 }; |
| 424 }); | 420 }); |
| OLD | NEW |