Chromium Code Reviews| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 // initDaemonUi is called if the app is not starting up in session mode, and | 88 // initDaemonUi is called if the app is not starting up in session mode, and |
| 89 // also if the user cancels pin entry or the connection in session mode. | 89 // also if the user cancels pin entry or the connection in session mode. |
| 90 remoting.initDaemonUi = function () { | 90 remoting.initDaemonUi = function () { |
| 91 remoting.hostController = new remoting.HostController(); | 91 remoting.hostController = new remoting.HostController(); |
| 92 remoting.hostController.updateDom(); | 92 remoting.hostController.updateDom(); |
| 93 remoting.setMode(getAppStartupMode_()); | 93 remoting.setMode(getAppStartupMode_()); |
| 94 remoting.hostSetupDialog = | 94 remoting.hostSetupDialog = |
| 95 new remoting.HostSetupDialog(remoting.hostController); | 95 new remoting.HostSetupDialog(remoting.hostController); |
| 96 // Display the cached host list, then refresh and display the current state. | |
|
Wez
2012/07/11 20:48:10
nit: Display the cached host list, and asynchronou
Jamie
2012/07/11 20:53:11
Done (more or less).
| |
| 96 remoting.extractThisHostAndDisplay(true); | 97 remoting.extractThisHostAndDisplay(true); |
| 97 remoting.hostList.refresh(remoting.extractThisHostAndDisplay); | 98 remoting.hostList.refresh(remoting.extractThisHostAndDisplay); |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 /** | 101 /** |
| 101 * Extract the remoting.Host object corresponding to this host (if any) and | 102 * Extract the remoting.Host object corresponding to this host (if any) and |
| 102 * display the list. | 103 * display the list. |
| 103 * | 104 * |
| 104 * @param {boolean} success True if the host list refresh was successful. | 105 * @param {boolean} success True if the host list refresh was successful. |
| 105 * @return {void} Nothing. | 106 * @return {void} Nothing. |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 */ | 336 */ |
| 336 remoting.defaultOAuthErrorHandler = function(error) { | 337 remoting.defaultOAuthErrorHandler = function(error) { |
| 337 l10n.localizeElementFromTag( | 338 l10n.localizeElementFromTag( |
| 338 document.getElementById('token-refresh-error-message'), | 339 document.getElementById('token-refresh-error-message'), |
| 339 error); | 340 error); |
| 340 var auth_failed = (error == remoting.Error.AUTHENTICATION_FAILED); | 341 var auth_failed = (error == remoting.Error.AUTHENTICATION_FAILED); |
| 341 document.getElementById('token-refresh-auth-failed').hidden = !auth_failed; | 342 document.getElementById('token-refresh-auth-failed').hidden = !auth_failed; |
| 342 document.getElementById('token-refresh-other-error').hidden = auth_failed; | 343 document.getElementById('token-refresh-other-error').hidden = auth_failed; |
| 343 remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED); | 344 remoting.setMode(remoting.AppMode.TOKEN_REFRESH_FAILED); |
| 344 }; | 345 }; |
| OLD | NEW |