| 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 30 matching lines...) Expand all Loading... |
| 41 remoting.oauth2.doAuthRedirect(); | 41 remoting.oauth2.doAuthRedirect(); |
| 42 }; | 42 }; |
| 43 var stopDaemon = function() { | 43 var stopDaemon = function() { |
| 44 remoting.daemonPlugin.stop(); | 44 remoting.daemonPlugin.stop(); |
| 45 remoting.daemonPlugin.updateDom(); | 45 remoting.daemonPlugin.updateDom(); |
| 46 }; | 46 }; |
| 47 /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */ | 47 /** @type {Array.<{event: string, id: string, fn: function(Event):void}>} */ |
| 48 var actions = [ | 48 var actions = [ |
| 49 { event: 'click', id: 'clear-oauth', fn: remoting.clearOAuth2 }, | 49 { event: 'click', id: 'clear-oauth', fn: remoting.clearOAuth2 }, |
| 50 { event: 'click', id: 'toolbar-disconnect', fn: remoting.disconnect }, | 50 { event: 'click', id: 'toolbar-disconnect', fn: remoting.disconnect }, |
| 51 { event: 'click', id: 'toggle-scaling', fn: remoting.toggleScaleToFit }, | |
| 52 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, | 51 { event: 'click', id: 'auth-button', fn: doAuthRedirect }, |
| 53 { event: 'click', id: 'share-button', fn: remoting.tryShare }, | 52 { event: 'click', id: 'share-button', fn: remoting.tryShare }, |
| 54 { event: 'click', id: 'access-mode-button', fn: goEnterAccessCode }, | 53 { event: 'click', id: 'access-mode-button', fn: goEnterAccessCode }, |
| 55 { event: 'click', id: 'cancel-share-button', fn: remoting.cancelShare }, | 54 { event: 'click', id: 'cancel-share-button', fn: remoting.cancelShare }, |
| 56 { event: 'click', id: 'stop-sharing-button', fn: remoting.cancelShare }, | 55 { event: 'click', id: 'stop-sharing-button', fn: remoting.cancelShare }, |
| 57 { event: 'click', id: 'host-finished-button', fn: goHome }, | 56 { event: 'click', id: 'host-finished-button', fn: goHome }, |
| 58 { event: 'click', id: 'client-finished-it2me-button', | 57 { event: 'click', id: 'client-finished-it2me-button', |
| 59 fn: goFinishedIt2Me }, | 58 fn: goFinishedIt2Me }, |
| 60 { event: 'click', id: 'client-finished-me2me-button', fn: goHome }, | 59 { event: 'click', id: 'client-finished-me2me-button', fn: goHome }, |
| 61 { event: 'click', id: 'cancel-pin-entry-button', fn: cancelPinEntry }, | 60 { event: 'click', id: 'cancel-pin-entry-button', fn: cancelPinEntry }, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 90 } | 89 } |
| 91 | 90 |
| 92 function onBeforeUnload() { | 91 function onBeforeUnload() { |
| 93 return remoting.promptClose(); | 92 return remoting.promptClose(); |
| 94 } | 93 } |
| 95 | 94 |
| 96 window.addEventListener('load', onLoad, false); | 95 window.addEventListener('load', onLoad, false); |
| 97 window.addEventListener('beforeunload', onBeforeUnload, false); | 96 window.addEventListener('beforeunload', onBeforeUnload, false); |
| 98 window.addEventListener('resize', remoting.onResize, false); | 97 window.addEventListener('resize', remoting.onResize, false); |
| 99 window.addEventListener('unload', remoting.disconnect, false); | 98 window.addEventListener('unload', remoting.disconnect, false); |
| OLD | NEW |