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. |
11 var container = null; | 11 var container = null; |
12 | 12 |
13 function onNotifyRouteCreationTimeout() { | |
14 container.isLaunching = false; | |
imcheng
2015/10/02 21:57:30
do we also need to set the launch state for the si
apacible
2015/10/02 23:45:16
See thread in media_router_container.js.
| |
15 } | |
16 | |
13 /** | 17 /** |
14 * Handles response of previous create route attempt. | 18 * Handles response of previous create route attempt. |
15 * | 19 * |
16 * @param {string} sinkId The ID of the sink to which the Media Route was | 20 * @param {string} sinkId The ID of the sink to which the Media Route was |
17 * creating a route. | 21 * creating a route. |
18 * @param {?media_router.Route} route The newly create route to the sink | 22 * @param {?media_router.Route} route The newly create route to the sink |
19 * if route creation succeeded; null otherwise | 23 * if route creation succeeded; null otherwise |
20 */ | 24 */ |
21 function onCreateRouteResponseReceived(sinkId, route) { | 25 function onCreateRouteResponseReceived(sinkId, route) { |
22 container.onCreateRouteResponseReceived(sinkId, route); | 26 container.onCreateRouteResponseReceived(sinkId, route); |
(...skipping 14 matching lines...) Expand all Loading... | |
37 * @param {!MediaRouterContainerElement} mediaRouterContainer | 41 * @param {!MediaRouterContainerElement} mediaRouterContainer |
38 */ | 42 */ |
39 function setContainer(mediaRouterContainer) { | 43 function setContainer(mediaRouterContainer) { |
40 container = mediaRouterContainer; | 44 container = mediaRouterContainer; |
41 } | 45 } |
42 | 46 |
43 /** | 47 /** |
44 * Populates the WebUI with data obtained from Media Router. | 48 * Populates the WebUI with data obtained from Media Router. |
45 * | 49 * |
46 * @param {headerText: string, | 50 * @param {headerText: string, |
47 * headerTextTooltip: string, | 51 * headerTextTooltip: string,- |
imcheng
2015/10/02 21:57:30
extra - at the end
apacible
2015/10/02 23:45:16
Done.
| |
48 * deviceMissingUrl: string, | 52 * deviceMissingUrl: string, |
49 * sinks: !Array<!media_router.Sink>, | 53 * sinks: !Array<!media_router.Sink>, |
50 * routes: !Array<!media_router.Route>, | 54 * routes: !Array<!media_router.Route>, |
51 * castModes: !Array<!media_router.CastMode>} data | 55 * castModes: !Array<!media_router.CastMode>} data |
52 * Parameters in data: | 56 * Parameters in data: |
53 * headerText - text to be displayed in the header of the WebUI. | 57 * headerText - text to be displayed in the header of the WebUI. |
54 * headerTextTooltip - tooltip to be displayed for the header of the WebUI. | 58 * headerTextTooltip - tooltip to be displayed for the header of the WebUI. |
55 * deviceMissingUrl - url to be opened on "Device missing?" clicked. | 59 * deviceMissingUrl - url to be opened on "Device missing?" clicked. |
56 * sinks - list of sinks to be displayed. | 60 * sinks - list of sinks to be displayed. |
57 * routes - list of routes that are associated with the sinks. | 61 * routes - list of routes that are associated with the sinks. |
(...skipping 30 matching lines...) Expand all Loading... | |
88 /** | 92 /** |
89 * Sets the list of discovered sinks. | 93 * Sets the list of discovered sinks. |
90 * | 94 * |
91 * @param {!Array<!media_router.Sink>} sinkList | 95 * @param {!Array<!media_router.Sink>} sinkList |
92 */ | 96 */ |
93 function setSinkList(sinkList) { | 97 function setSinkList(sinkList) { |
94 container.sinkList = sinkList; | 98 container.sinkList = sinkList; |
95 } | 99 } |
96 | 100 |
97 return { | 101 return { |
102 onNotifyRouteCreationTimeout: onNotifyRouteCreationTimeout, | |
98 onCreateRouteResponseReceived: onCreateRouteResponseReceived, | 103 onCreateRouteResponseReceived: onCreateRouteResponseReceived, |
99 setCastModeList: setCastModeList, | 104 setCastModeList: setCastModeList, |
100 setContainer: setContainer, | 105 setContainer: setContainer, |
101 setInitialData: setInitialData, | 106 setInitialData: setInitialData, |
102 setIssue: setIssue, | 107 setIssue: setIssue, |
103 setRouteList: setRouteList, | 108 setRouteList: setRouteList, |
104 setSinkList: setSinkList, | 109 setSinkList: setSinkList, |
105 }; | 110 }; |
106 }); | 111 }); |
107 | 112 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 } | 163 } |
159 | 164 |
160 return { | 165 return { |
161 actOnIssue: actOnIssue, | 166 actOnIssue: actOnIssue, |
162 closeDialog: closeDialog, | 167 closeDialog: closeDialog, |
163 closeRoute: closeRoute, | 168 closeRoute: closeRoute, |
164 requestInitialData: requestInitialData, | 169 requestInitialData: requestInitialData, |
165 requestRoute: requestRoute, | 170 requestRoute: requestRoute, |
166 }; | 171 }; |
167 }); | 172 }); |
OLD | NEW |