| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 * Populates the WebUI with data obtained from Media Router. | 81 * Populates the WebUI with data obtained from Media Router. |
| 82 * | 82 * |
| 83 * @param {{deviceMissingUrl: string, | 83 * @param {{deviceMissingUrl: string, |
| 84 * sinksAndIdentity: { | 84 * sinksAndIdentity: { |
| 85 * sinks: !Array<!media_router.Sink>, | 85 * sinks: !Array<!media_router.Sink>, |
| 86 * showEmail: boolean, | 86 * showEmail: boolean, |
| 87 * userEmail: string, | 87 * userEmail: string, |
| 88 * showDomain: boolean | 88 * showDomain: boolean |
| 89 * }, | 89 * }, |
| 90 * routes: !Array<!media_router.Route>, | 90 * routes: !Array<!media_router.Route>, |
| 91 * castModes: !Array<!media_router.CastMode>}} data | 91 * castModes: !Array<!media_router.CastMode>, |
| 92 * isOffTheRecord: boolean}} data |
| 92 * Parameters in data: | 93 * Parameters in data: |
| 93 * deviceMissingUrl - url to be opened on "Device missing?" clicked. | 94 * deviceMissingUrl - url to be opened on "Device missing?" clicked. |
| 94 * sinksAndIdentity - list of sinks to be displayed and user identity. | 95 * sinksAndIdentity - list of sinks to be displayed and user identity. |
| 95 * routes - list of routes that are associated with the sinks. | 96 * routes - list of routes that are associated with the sinks. |
| 96 * castModes - list of available cast modes. | 97 * castModes - list of available cast modes. |
| 98 * isOffTheRecord - whether or not the browser is currently incognito. |
| 97 */ | 99 */ |
| 98 function setInitialData(data) { | 100 function setInitialData(data) { |
| 99 container.deviceMissingUrl = data['deviceMissingUrl']; | 101 container.deviceMissingUrl = data['deviceMissingUrl']; |
| 100 container.castModeList = data['castModes']; | 102 container.castModeList = data['castModes']; |
| 101 this.setSinkListAndIdentity(data['sinksAndIdentity']); | 103 this.setSinkListAndIdentity(data['sinksAndIdentity']); |
| 104 container.isOffTheRecord = data['isOffTheRecord']; |
| 102 container.routeList = data['routes']; | 105 container.routeList = data['routes']; |
| 103 container.maybeShowRouteDetailsOnOpen(); | 106 container.maybeShowRouteDetailsOnOpen(); |
| 104 media_router.browserApi.onInitialDataReceived(); | 107 media_router.browserApi.onInitialDataReceived(); |
| 105 } | 108 } |
| 106 | 109 |
| 107 /** | 110 /** |
| 108 * Sets current issue to |issue|, or clears the current issue if |issue| is | 111 * Sets current issue to |issue|, or clears the current issue if |issue| is |
| 109 * null. | 112 * null. |
| 110 * | 113 * |
| 111 * @param {?media_router.Issue} issue | 114 * @param {?media_router.Issue} issue |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 reportRouteCreation: reportRouteCreation, | 372 reportRouteCreation: reportRouteCreation, |
| 370 reportRouteCreationOutcome: reportRouteCreationOutcome, | 373 reportRouteCreationOutcome: reportRouteCreationOutcome, |
| 371 reportSelectedCastMode: reportSelectedCastMode, | 374 reportSelectedCastMode: reportSelectedCastMode, |
| 372 reportSinkCount: reportSinkCount, | 375 reportSinkCount: reportSinkCount, |
| 373 reportTimeToClickSink: reportTimeToClickSink, | 376 reportTimeToClickSink: reportTimeToClickSink, |
| 374 reportTimeToInitialActionClose: reportTimeToInitialActionClose, | 377 reportTimeToInitialActionClose: reportTimeToInitialActionClose, |
| 375 requestInitialData: requestInitialData, | 378 requestInitialData: requestInitialData, |
| 376 requestRoute: requestRoute, | 379 requestRoute: requestRoute, |
| 377 }; | 380 }; |
| 378 }); | 381 }); |
| OLD | NEW |