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 <include src="media_router_data.js"> | 5 <include src="media_router_data.js"> |
6 <include src="media_router_ui_interface.js"> | 6 <include src="media_router_ui_interface.js"> |
7 | 7 |
8 // Handles user events for the Media Router UI. | 8 // Handles user events for the Media Router UI. |
9 cr.define('media_router', function() { | 9 cr.define('media_router', function() { |
10 'use strict'; | 10 'use strict'; |
(...skipping 10 matching lines...) Expand all Loading... | |
21 | 21 |
22 /** | 22 /** |
23 * Initializes the Media Router WebUI and requests initial media | 23 * Initializes the Media Router WebUI and requests initial media |
24 * router content, such as the media sink and media route lists. | 24 * router content, such as the media sink and media route lists. |
25 */ | 25 */ |
26 function initialize() { | 26 function initialize() { |
27 media_router.browserApi.requestInitialData(); | 27 media_router.browserApi.requestInitialData(); |
28 | 28 |
29 container = /** @type {!MediaRouterContainerElement} */ | 29 container = /** @type {!MediaRouterContainerElement} */ |
30 ($('media-router-container')); | 30 ($('media-router-container')); |
31 media_router.ui.setContainer(container); | 31 |
32 var header = /** @type {!MediaRouterHeaderElement} */ | |
33 ($('media-router-header')); | |
34 | |
35 media_router.ui.setElements(container, header); | |
apacible
2016/02/13 08:13:02
Inline the header here. We set |container| as a va
amp
2016/02/16 22:19:12
Done.
| |
32 | 36 |
33 container.addEventListener('acknowledge-first-run-flow', | 37 container.addEventListener('acknowledge-first-run-flow', |
34 onAcknowledgeFirstRunFlow); | 38 onAcknowledgeFirstRunFlow); |
35 container.addEventListener('back-click', onNavigateToSinkList); | 39 container.addEventListener('back-click', onNavigateToSinkList); |
36 container.addEventListener('cast-mode-selected', onCastModeSelected); | 40 container.addEventListener('cast-mode-selected', onCastModeSelected); |
37 container.addEventListener('close-button-click', onCloseDialogEvent); | 41 container.addEventListener('close-button-click', onCloseDialogEvent); |
38 container.addEventListener('close-dialog', onCloseDialogEvent); | 42 container.addEventListener('close-dialog', onCloseDialogEvent); |
39 container.addEventListener('close-route-click', onCloseRouteClick); | 43 container.addEventListener('close-route-click', onCloseRouteClick); |
40 container.addEventListener('create-route', onCreateRoute); | 44 container.addEventListener('create-route', onCreateRoute); |
41 container.addEventListener('issue-action-click', onIssueActionClick); | 45 container.addEventListener('issue-action-click', onIssueActionClick); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 var detail = event.detail; | 299 var detail = event.detail; |
296 media_router.browserApi.reportSinkCount(detail.sinkCount); | 300 media_router.browserApi.reportSinkCount(detail.sinkCount); |
297 } | 301 } |
298 | 302 |
299 return { | 303 return { |
300 initialize: initialize, | 304 initialize: initialize, |
301 }; | 305 }; |
302 }); | 306 }); |
303 | 307 |
304 window.addEventListener('load', media_router.initialize); | 308 window.addEventListener('load', media_router.initialize); |
OLD | NEW |