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

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

Issue 265393005: Implement apps v2 custom window frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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/client_session.js ('k') | remoting/webapp/fullscreen_v2.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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, 94 { event: 'click', id: 'token-refresh-error-ok', fn: goHome },
95 { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect } 95 { event: 'click', id: 'token-refresh-error-sign-in', fn: doAuthRedirect }
96 ]; 96 ];
97 registerEventListeners(it2me_actions); 97 registerEventListeners(it2me_actions);
98 registerEventListeners(me2me_actions); 98 registerEventListeners(me2me_actions);
99 registerEventListeners(host_actions); 99 registerEventListeners(host_actions);
100 registerEventListeners(auth_actions); 100 registerEventListeners(auth_actions);
101 remoting.init(); 101 remoting.init();
102 102
103 window.addEventListener('resize', remoting.onResize, false); 103 window.addEventListener('resize', remoting.onResize, false);
104 // When a window goes full-screen, a resize event is triggered, but the
105 // Fullscreen.isActive call is not guaranteed to return true until the
106 // full-screen event is triggered. In apps v2, the size of the window's
107 // client area is calculated differently in full-screen mode, so register
108 // for both events.
109 remoting.fullscreen.addListener(remoting.onResize);
104 if (!remoting.isAppsV2) { 110 if (!remoting.isAppsV2) {
105 window.addEventListener('beforeunload', remoting.promptClose, false); 111 window.addEventListener('beforeunload', remoting.promptClose, false);
106 window.addEventListener('unload', remoting.disconnect, false); 112 window.addEventListener('unload', remoting.disconnect, false);
107 } 113 }
108 } 114 }
109 115
110 /** 116 /**
111 * @param {Array.<{event: string, id: string, 117 * @param {Array.<{event: string, id: string,
112 * fn: function(Event):void}>} actions Array of actions to register. 118 * fn: function(Event):void}>} actions Array of actions to register.
113 */ 119 */
(...skipping 15 matching lines...) Expand all
129 if (element) { 135 if (element) {
130 element.addEventListener(eventname, fn, false); 136 element.addEventListener(eventname, fn, false);
131 } else { 137 } else {
132 console.error('Could not set ' + eventname + 138 console.error('Could not set ' + eventname +
133 ' event handler on element ' + id + 139 ' event handler on element ' + id +
134 ': element not found.'); 140 ': element not found.');
135 } 141 }
136 } 142 }
137 143
138 window.addEventListener('load', onLoad, false); 144 window.addEventListener('load', onLoad, false);
OLDNEW
« no previous file with comments | « remoting/webapp/client_session.js ('k') | remoting/webapp/fullscreen_v2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698