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 remoting.initElementEventHandlers = function() { | 10 remoting.initElementEventHandlers = function() { |
(...skipping 18 matching lines...) Expand all Loading... |
29 goHome(); | 29 goHome(); |
30 } | 30 } |
31 }; | 31 }; |
32 /** @param {Event} event The event. */ | 32 /** @param {Event} event The event. */ |
33 var sendAccessCode = function(event) { | 33 var sendAccessCode = function(event) { |
34 remoting.connectIT2Me(); | 34 remoting.connectIT2Me(); |
35 event.preventDefault(); | 35 event.preventDefault(); |
36 }; | 36 }; |
37 var reconnect = function() { | 37 var reconnect = function() { |
38 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); | 38 remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); |
39 remoting.connector.reconnect(); | 39 remoting.app.getSessionConnector().reconnect(); |
40 }; | 40 }; |
41 var doAuthRedirect = function() { | 41 var doAuthRedirect = function() { |
42 if (!base.isAppsV2()) { | 42 if (!base.isAppsV2()) { |
43 remoting.oauth2.doAuthRedirect(function() { | 43 remoting.oauth2.doAuthRedirect(function() { |
44 window.location.reload(); | 44 window.location.reload(); |
45 }); | 45 }); |
46 } | 46 } |
47 }; | 47 }; |
48 var fixAuthError = function() { | 48 var fixAuthError = function() { |
49 if (base.isAppsV2()) { | 49 if (base.isAppsV2()) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 function registerEventListener(id, eventname, fn) { | 151 function registerEventListener(id, eventname, fn) { |
152 var element = document.getElementById(id); | 152 var element = document.getElementById(id); |
153 if (element) { | 153 if (element) { |
154 element.addEventListener(eventname, fn, false); | 154 element.addEventListener(eventname, fn, false); |
155 } else { | 155 } else { |
156 console.error('Could not set ' + eventname + | 156 console.error('Could not set ' + eventname + |
157 ' event handler on element ' + id + | 157 ' event handler on element ' + id + |
158 ': element not found.'); | 158 ': element not found.'); |
159 } | 159 } |
160 } | 160 } |
OLD | NEW |