Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, | 108 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, |
| 109 { event: 'click', id: 'cancel-connect-button', fn: goHome }, | 109 { event: 'click', id: 'cancel-connect-button', fn: goHome }, |
| 110 { event: 'click', id: 'sign-out', fn:remoting.signOut }, | 110 { event: 'click', id: 'sign-out', fn:remoting.signOut }, |
| 111 { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, | 111 { event: 'click', id: 'token-refresh-error-ok', fn: goHome }, |
| 112 { event: 'click', id: 'token-refresh-error-sign-in', fn: fixAuthError } | 112 { event: 'click', id: 'token-refresh-error-sign-in', fn: fixAuthError } |
| 113 ]; | 113 ]; |
| 114 registerEventListeners(it2me_actions); | 114 registerEventListeners(it2me_actions); |
| 115 registerEventListeners(me2me_actions); | 115 registerEventListeners(me2me_actions); |
| 116 registerEventListeners(host_actions); | 116 registerEventListeners(host_actions); |
| 117 registerEventListeners(auth_actions); | 117 registerEventListeners(auth_actions); |
| 118 remoting.init(); | 118 remoting.initForTesting(); |
|
garykac
2014/12/02 16:43:22
Note that https://codereview.chromium.org/74247300
| |
| 119 | 119 |
| 120 window.addEventListener('resize', remoting.onResize, false); | 120 window.addEventListener('resize', remoting.onResize, false); |
| 121 // When a window goes full-screen, a resize event is triggered, but the | 121 // When a window goes full-screen, a resize event is triggered, but the |
| 122 // Fullscreen.isActive call is not guaranteed to return true until the | 122 // Fullscreen.isActive call is not guaranteed to return true until the |
| 123 // full-screen event is triggered. In apps v2, the size of the window's | 123 // full-screen event is triggered. In apps v2, the size of the window's |
| 124 // client area is calculated differently in full-screen mode, so register | 124 // client area is calculated differently in full-screen mode, so register |
| 125 // for both events. | 125 // for both events. |
| 126 remoting.fullscreen.addListener(remoting.onResize); | 126 remoting.fullscreen.addListener(remoting.onResize); |
| 127 if (!base.isAppsV2()) { | 127 if (!base.isAppsV2()) { |
| 128 window.addEventListener('beforeunload', remoting.promptClose, false); | 128 window.addEventListener('beforeunload', remoting.promptClose, false); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 152 if (element) { | 152 if (element) { |
| 153 element.addEventListener(eventname, fn, false); | 153 element.addEventListener(eventname, fn, false); |
| 154 } else { | 154 } else { |
| 155 console.error('Could not set ' + eventname + | 155 console.error('Could not set ' + eventname + |
| 156 ' event handler on element ' + id + | 156 ' event handler on element ' + id + |
| 157 ': element not found.'); | 157 ': element not found.'); |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 window.addEventListener('load', onLoad, false); | 161 window.addEventListener('load', onLoad, false); |
| OLD | NEW |