| 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 /** @type {remoting.HostSession} */ remoting.hostSession = null; | 10 /** @type {remoting.HostSession} */ remoting.hostSession = null; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 remoting.init = function() { | 33 remoting.init = function() { |
| 34 remoting.logExtensionInfoAsync_(); | 34 remoting.logExtensionInfoAsync_(); |
| 35 l10n.localize(); | 35 l10n.localize(); |
| 36 // Create global objects. | 36 // Create global objects. |
| 37 remoting.oauth2 = new remoting.OAuth2(); | 37 remoting.oauth2 = new remoting.OAuth2(); |
| 38 remoting.stats = new remoting.ConnectionStats( | 38 remoting.stats = new remoting.ConnectionStats( |
| 39 document.getElementById('statistics')); | 39 document.getElementById('statistics')); |
| 40 remoting.formatIq = new remoting.FormatIq(); | 40 remoting.formatIq = new remoting.FormatIq(); |
| 41 remoting.hostList = new remoting.HostList( | 41 remoting.hostList = new remoting.HostList( |
| 42 document.getElementById('host-list'), | 42 document.getElementById('host-list'), |
| 43 document.getElementById('host-list-empty'), |
| 43 document.getElementById('host-list-error-message'), | 44 document.getElementById('host-list-error-message'), |
| 44 document.getElementById('host-list-refresh-failed-button')); | 45 document.getElementById('host-list-refresh-failed-button')); |
| 45 remoting.toolbar = new remoting.Toolbar( | 46 remoting.toolbar = new remoting.Toolbar( |
| 46 document.getElementById('session-toolbar')); | 47 document.getElementById('session-toolbar')); |
| 47 remoting.clipboard = new remoting.Clipboard(); | 48 remoting.clipboard = new remoting.Clipboard(); |
| 48 | 49 |
| 49 refreshEmail_(); | 50 refreshEmail_(); |
| 50 var email = remoting.oauth2.getCachedEmail(); | 51 var email = remoting.oauth2.getCachedEmail(); |
| 51 if (email) { | 52 if (email) { |
| 52 document.getElementById('current-email').innerText = email; | 53 document.getElementById('current-email').innerText = email; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 */ | 335 */ |
| 335 remoting.defaultOAuthErrorHandler = function(error) { | 336 remoting.defaultOAuthErrorHandler = function(error) { |
| 336 l10n.localizeElementFromTag( | 337 l10n.localizeElementFromTag( |
| 337 document.getElementById('token-refresh-error-message'), | 338 document.getElementById('token-refresh-error-message'), |
| 338 error); | 339 error); |
| 339 var auth_failed = (error == remoting.Error.AUTHENTICATION_FAILED); | 340 var auth_failed = (error == remoting.Error.AUTHENTICATION_FAILED); |
| 340 document.getElementById('token-refresh-auth-failed').hidden = !auth_failed; | 341 document.getElementById('token-refresh-auth-failed').hidden = !auth_failed; |
| 341 document.getElementById('token-refresh-other-error').hidden = auth_failed; | 342 document.getElementById('token-refresh-other-error').hidden = auth_failed; |
| 342 remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED); | 343 remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED); |
| 343 }; | 344 }; |
| OLD | NEW |