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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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); |
OLD | NEW |