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

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

Issue 1413403003: [Media Router] Auto-close Media Router dialog after starting or stopping a session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix missed renaming. Created 5 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 <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';
11 11
12 // The media-router-container element. Initialized after polymer is ready. 12 // The media-router-container element. Initialized after polymer is ready.
13 var container = null; 13 var container = null;
14 14
15 /** 15 /**
16 * Initializes the Media Router WebUI and requests initial media 16 * Initializes the Media Router WebUI and requests initial media
17 * router content, such as the media sink and media route lists. 17 * router content, such as the media sink and media route lists.
18 */ 18 */
19 function initialize() { 19 function initialize() {
20 media_router.browserApi.requestInitialData(); 20 media_router.browserApi.requestInitialData();
21 21
22 container = $('media-router-container'); 22 container = $('media-router-container');
23 media_router.ui.setContainer(container); 23 media_router.ui.setContainer(container);
24 24
25 container.addEventListener('close-button-click', onCloseDialogClick); 25 container.addEventListener('close-button-click', onCloseDialogEvent);
26 container.addEventListener('close-dialog', onCloseDialogEvent);
26 container.addEventListener('close-route-click', onCloseRouteClick); 27 container.addEventListener('close-route-click', onCloseRouteClick);
27 container.addEventListener('create-route', onCreateRoute); 28 container.addEventListener('create-route', onCreateRoute);
28 container.addEventListener('issue-action-click', onIssueActionClick); 29 container.addEventListener('issue-action-click', onIssueActionClick);
29 } 30 }
30 31
31 /** 32 /**
32 * Closes the dialog. 33 * Closes the dialog.
33 * Called when the user clicks the close button on the dialog. 34 * Called when the user clicks the close button on the dialog.
34 */ 35 */
35 function onCloseDialogClick() { 36 function onCloseDialogEvent() {
36 media_router.browserApi.closeDialog(); 37 media_router.browserApi.closeDialog();
37 } 38 }
38 39
39 /** 40 /**
40 * Acts on an issue and dismisses it from the UI. 41 * Acts on an issue and dismisses it from the UI.
41 * Called when the user performs an action on an issue. 42 * Called when the user performs an action on an issue.
42 * 43 *
43 * @param {{detail: {id: string, actionType: number, helpPageId: number}}} 44 * @param {{detail: {id: string, actionType: number, helpPageId: number}}}
44 * data 45 * data
45 * Parameters in |data|.detail: 46 * Parameters in |data|.detail:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 function onCloseRouteClick(data) { 80 function onCloseRouteClick(data) {
80 media_router.browserApi.closeRoute(data.detail.route); 81 media_router.browserApi.closeRoute(data.detail.route);
81 } 82 }
82 83
83 return { 84 return {
84 initialize: initialize, 85 initialize: initialize,
85 }; 86 };
86 }); 87 });
87 88
88 window.addEventListener('load', media_router.initialize); 89 window.addEventListener('load', media_router.initialize);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698