| 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.initEventHandlers = function() { | 10 remoting.initEventHandlers = 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 function registerEventListener(id, eventname, fn) { | 149 function registerEventListener(id, eventname, fn) { |
| 150 var element = document.getElementById(id); | 150 var element = document.getElementById(id); |
| 151 if (element) { | 151 if (element) { |
| 152 element.addEventListener(eventname, fn, false); | 152 element.addEventListener(eventname, fn, false); |
| 153 } else { | 153 } else { |
| 154 console.error('Could not set ' + eventname + | 154 console.error('Could not set ' + eventname + |
| 155 ' event handler on element ' + id + | 155 ' event handler on element ' + id + |
| 156 ': element not found.'); | 156 ': element not found.'); |
| 157 } | 157 } |
| 158 } | 158 } |
| OLD | NEW |