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

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

Issue 1800213002: [Media Router WebUI] Update ESC handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 months 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
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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';
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 container.addEventListener('report-sink-click-time', 49 container.addEventListener('report-sink-click-time',
50 onSinkClickTimeReported); 50 onSinkClickTimeReported);
51 container.addEventListener('report-sink-count', onSinkCountReported); 51 container.addEventListener('report-sink-count', onSinkCountReported);
52 container.addEventListener('report-resolved-route', 52 container.addEventListener('report-resolved-route',
53 onReportRouteCreationOutcome); 53 onReportRouteCreationOutcome);
54 container.addEventListener('show-initial-state', onShowInitialState); 54 container.addEventListener('show-initial-state', onShowInitialState);
55 container.addEventListener('sink-click', onSinkClick); 55 container.addEventListener('sink-click', onSinkClick);
56 container.addEventListener('start-casting-to-route-click', 56 container.addEventListener('start-casting-to-route-click',
57 onStartCastingToRouteClick); 57 onStartCastingToRouteClick);
58 58
59 // Pressing the ESC key closes the dialog.
60 document.addEventListener('keydown', function(e) {
61 if (e.keyCode == media_router.KEYCODE_ESC) {
62 container.maybeReportUserFirstAction(
63 media_router.MediaRouterUserAction.CLOSE);
64 }
65 });
66
67 window.addEventListener('blur', onWindowBlur); 59 window.addEventListener('blur', onWindowBlur);
68 } 60 }
69 61
70 /** 62 /**
71 * Reports the selected cast mode. 63 * Reports the selected cast mode.
72 * Called when the user selects a cast mode from the picker. 64 * Called when the user selects a cast mode from the picker.
73 * 65 *
74 * @param {!Event} event 66 * @param {!Event} event
75 * Parameters in |event|.detail: 67 * Parameters in |event|.detail:
76 * castModeType - type of cast mode selected by the user. 68 * castModeType - type of cast mode selected by the user.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 function onWindowBlur() { 331 function onWindowBlur() {
340 media_router.browserApi.reportBlur(); 332 media_router.browserApi.reportBlur();
341 } 333 }
342 334
343 return { 335 return {
344 initialize: initialize, 336 initialize: initialize,
345 }; 337 };
346 }); 338 });
347 339
348 window.addEventListener('load', media_router.initialize); 340 window.addEventListener('load', media_router.initialize);
OLDNEW
« no previous file with comments | « chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698