| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 * sinksAndIdentity - list of sinks to be displayed and user identity. | 113 * sinksAndIdentity - list of sinks to be displayed and user identity. |
| 114 * useWebUiRouteControls - whether new WebUI route controls should be used. | 114 * useWebUiRouteControls - whether new WebUI route controls should be used. |
| 115 * routes - list of routes that are associated with the sinks. | 115 * routes - list of routes that are associated with the sinks. |
| 116 * castModes - list of available cast modes. | 116 * castModes - list of available cast modes. |
| 117 * useTabMirroring - whether the cast mode should be set to TAB_MIRROR. | 117 * useTabMirroring - whether the cast mode should be set to TAB_MIRROR. |
| 118 */ | 118 */ |
| 119 function setInitialData(data) { | 119 function setInitialData(data) { |
| 120 container.deviceMissingUrl = data['deviceMissingUrl']; | 120 container.deviceMissingUrl = data['deviceMissingUrl']; |
| 121 container.castModeList = data['castModes']; | 121 container.castModeList = data['castModes']; |
| 122 this.setSinkListAndIdentity(data['sinksAndIdentity']); | 122 this.setSinkListAndIdentity(data['sinksAndIdentity']); |
| 123 container.useWebUiRouteControls = !!data['useWebUiRouteControls']; | |
| 124 container.routeList = data['routes']; | 123 container.routeList = data['routes']; |
| 125 container.maybeShowRouteDetailsOnOpen(); | 124 container.maybeShowRouteDetailsOnOpen(); |
| 126 if (data['useTabMirroring']) | 125 if (data['useTabMirroring']) |
| 127 container.selectCastMode(media_router.CastModeType.TAB_MIRROR); | 126 container.selectCastMode(media_router.CastModeType.TAB_MIRROR); |
| 128 media_router.browserApi.onInitialDataReceived(); | 127 media_router.browserApi.onInitialDataReceived(); |
| 129 } | 128 } |
| 130 | 129 |
| 131 /** | 130 /** |
| 132 * Sets current issue to |issue|, or clears the current issue if |issue| is | 131 * Sets current issue to |issue|, or clears the current issue if |issue| is |
| 133 * null. | 132 * null. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 setInitialData: setInitialData, | 211 setInitialData: setInitialData, |
| 213 setIssue: setIssue, | 212 setIssue: setIssue, |
| 214 setRouteControls: setRouteControls, | 213 setRouteControls: setRouteControls, |
| 215 setRouteList: setRouteList, | 214 setRouteList: setRouteList, |
| 216 setSinkListAndIdentity: setSinkListAndIdentity, | 215 setSinkListAndIdentity: setSinkListAndIdentity, |
| 217 updateMaxHeight: updateMaxHeight, | 216 updateMaxHeight: updateMaxHeight, |
| 218 updateRouteStatus: updateRouteStatus, | 217 updateRouteStatus: updateRouteStatus, |
| 219 userSelectedLocalMediaFile: userSelectedLocalMediaFile, | 218 userSelectedLocalMediaFile: userSelectedLocalMediaFile, |
| 220 }; | 219 }; |
| 221 }); | 220 }); |
| OLD | NEW |