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

Side by Side Diff: remoting/webapp/event_handlers.js

Issue 336293003: Refactor tool-bar event handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « remoting/webapp/client_session.js ('k') | remoting/webapp/options_menu.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 'use strict'; 5 'use strict';
6 6
7 /** @suppress {duplicate} */ 7 /** @suppress {duplicate} */
8 var remoting = remoting || {}; 8 var remoting = remoting || {};
9 9
10 function onLoad() { 10 function onLoad() {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 { event: 'click', id: 'host-config-error-dismiss', fn: goHome }, 84 { event: 'click', id: 'host-config-error-dismiss', fn: goHome },
85 { event: 'click', id: 'open-paired-client-manager-dialog', 85 { event: 'click', id: 'open-paired-client-manager-dialog',
86 fn: remoting.setMode.bind(null, 86 fn: remoting.setMode.bind(null,
87 remoting.AppMode.HOME_MANAGE_PAIRINGS) }, 87 remoting.AppMode.HOME_MANAGE_PAIRINGS) },
88 { event: 'click', id: 'stop-sharing-button', fn: remoting.cancelShare } 88 { event: 'click', id: 'stop-sharing-button', fn: remoting.cancelShare }
89 ]; 89 ];
90 /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */ 90 /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */
91 var auth_actions = [ 91 var auth_actions = [
92 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, 92 { event: 'click', id: 'auth-button', fn: doAuthRedirect },
93 { event: 'click', id: 'cancel-connect-button', fn: goHome }, 93 { event: 'click', id: 'cancel-connect-button', fn: goHome },
94 { event: 'click', id: 'sign-out', fn:remoting.signOut },
94 { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, 95 { event: 'click', id: 'token-refresh-error-ok', fn: goHome },
95 { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect } 96 { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect }
96 ]; 97 ];
97 registerEventListeners(it2me_actions); 98 registerEventListeners(it2me_actions);
98 registerEventListeners(me2me_actions); 99 registerEventListeners(me2me_actions);
99 registerEventListeners(host_actions); 100 registerEventListeners(host_actions);
100 registerEventListeners(auth_actions); 101 registerEventListeners(auth_actions);
101 remoting.init(); 102 remoting.init();
102 103
103 window.addEventListener('resize', remoting.onResize, false); 104 window.addEventListener('resize', remoting.onResize, false);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (element) { 136 if (element) {
136 element.addEventListener(eventname, fn, false); 137 element.addEventListener(eventname, fn, false);
137 } else { 138 } else {
138 console.error('Could not set ' + eventname + 139 console.error('Could not set ' + eventname +
139 ' event handler on element ' + id + 140 ' event handler on element ' + id +
140 ': element not found.'); 141 ': element not found.');
141 } 142 }
142 } 143 }
143 144
144 window.addEventListener('load', onLoad, false); 145 window.addEventListener('load', onLoad, false);
OLDNEW
« no previous file with comments | « remoting/webapp/client_session.js ('k') | remoting/webapp/options_menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698