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

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

Issue 158113002: [Chromoting] Break up JS event handler registration into related groups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix alpha order Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « remoting/webapp/event_handlers.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 (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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class representing the client tool-bar. 7 * Class representing the client tool-bar.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 28 matching lines...) Expand all
39 this.stubLeft_ = 0; 39 this.stubLeft_ = 0;
40 /** 40 /**
41 * @type {number} The right edge of the tool-bar stub, updated on resize. 41 * @type {number} The right edge of the tool-bar stub, updated on resize.
42 * @private 42 * @private
43 */ 43 */
44 this.stubRight_ = 0; 44 this.stubRight_ = 0;
45 45
46 window.addEventListener('mousemove', remoting.Toolbar.onMouseMove, false); 46 window.addEventListener('mousemove', remoting.Toolbar.onMouseMove, false);
47 window.addEventListener('resize', this.center.bind(this), false); 47 window.addEventListener('resize', this.center.bind(this), false);
48 48
49 registerEventListener('new-connection', 'click',
50 function() {
51 chrome.app.window.create('main.html', { 'width': 800, 'height': 600 });
52 });
53 registerEventListener('send-ctrl-alt-del', 'click', remoting.sendCtrlAltDel);
54 registerEventListener('send-print-screen', 'click', remoting.sendPrintScreen);
55 registerEventListener('sign-out', 'click', remoting.signOut);
56 registerEventListener('toolbar-disconnect', 'click', remoting.disconnect);
57 registerEventListener('toolbar-stub', 'click',
58 function() { remoting.toolbar.toggle(); });
59
49 // Prevent the preview canceling if the user is interacting with the tool-bar. 60 // Prevent the preview canceling if the user is interacting with the tool-bar.
50 /** @type {remoting.Toolbar} */ 61 /** @type {remoting.Toolbar} */
51 var that = this; 62 var that = this;
52 var stopTimer = function() { 63 var stopTimer = function() {
53 if (that.timerId_) { 64 if (that.timerId_) {
54 window.clearTimeout(that.timerId_); 65 window.clearTimeout(that.timerId_);
55 that.timerId_ = null; 66 that.timerId_ = null;
56 } 67 }
57 } 68 }
58 this.toolbar_.addEventListener('mousemove', stopTimer, false); 69 this.toolbar_.addEventListener('mousemove', stopTimer, false);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 142 }
132 }; 143 };
133 144
134 /** @type {remoting.Toolbar} */ 145 /** @type {remoting.Toolbar} */
135 remoting.toolbar = null; 146 remoting.toolbar = null;
136 147
137 /** @private */ 148 /** @private */
138 remoting.Toolbar.STUB_EXTENDED_CLASS_ = 'toolbar-stub-extended'; 149 remoting.Toolbar.STUB_EXTENDED_CLASS_ = 'toolbar-stub-extended';
139 /** @private */ 150 /** @private */
140 remoting.Toolbar.VISIBLE_CLASS_ = 'toolbar-visible'; 151 remoting.Toolbar.VISIBLE_CLASS_ = 'toolbar-visible';
OLDNEW
« no previous file with comments | « remoting/webapp/event_handlers.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698