| 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 22 matching lines...) Expand all Loading... |
| 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.connector.reconnect(); |
| 40 }; | 40 }; |
| 41 var doAuthRedirect = function() { | 41 var doAuthRedirect = function() { |
| 42 if (!base.isAppsV2()) { | 42 if (!base.isAppsV2()) { |
| 43 remoting.oauth2.doAuthRedirect(); | 43 remoting.oauth2.doAuthRedirect(function() { |
| 44 window.location.reload(); |
| 45 }); |
| 44 } | 46 } |
| 45 }; | 47 }; |
| 46 var fixAuthError = function() { | 48 var fixAuthError = function() { |
| 47 if (base.isAppsV2()) { | 49 if (base.isAppsV2()) { |
| 48 var onRefresh = function() { | 50 var onRefresh = function() { |
| 49 remoting.hostList.display(); | 51 remoting.hostList.display(); |
| 50 }; | 52 }; |
| 51 var refreshHostList = function() { | 53 var refreshHostList = function() { |
| 52 goHome(); | 54 goHome(); |
| 53 remoting.hostList.refresh(onRefresh); | 55 remoting.hostList.refresh(onRefresh); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 if (element) { | 152 if (element) { |
| 151 element.addEventListener(eventname, fn, false); | 153 element.addEventListener(eventname, fn, false); |
| 152 } else { | 154 } else { |
| 153 console.error('Could not set ' + eventname + | 155 console.error('Could not set ' + eventname + |
| 154 ' event handler on element ' + id + | 156 ' event handler on element ' + id + |
| 155 ': element not found.'); | 157 ': element not found.'); |
| 156 } | 158 } |
| 157 } | 159 } |
| 158 | 160 |
| 159 window.addEventListener('load', onLoad, false); | 161 window.addEventListener('load', onLoad, false); |
| OLD | NEW |