Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/browser/resources/media_router/media_router_ui_interface.js

Issue 2487673003: [Media Router] Make per-hostname cast mode selections persist (Closed)
Patch Set: Address Jennifer's comments, rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
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
imcheng 2016/11/14 19:32:27 Please document initialCastMode.
takumif 2016/11/16 01:34:27 Done.
98 * }, 98 * },
99 * routes: !Array<!media_router.Route>, 99 * routes: !Array<!media_router.Route>,
100 * castModes: !Array<!media_router.CastMode>}} data 100 * castModes: !Array<!media_router.CastMode>}} data
101 * Parameters in data: 101 * Parameters in data:
102 * deviceMissingUrl - url to be opened on "Device missing?" clicked. 102 * deviceMissingUrl - url to be opened on "Device missing?" clicked.
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698