Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * This class implements the functionality that is specific to desktop | 7 * This class implements the functionality that is specific to desktop |
| 8 * remoting ("Chromoting" or CRD). | 8 * remoting ("Chromoting" or CRD). |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 /** | 272 /** |
| 273 * Called when an error needs to be displayed to the user. | 273 * Called when an error needs to be displayed to the user. |
| 274 * | 274 * |
| 275 * @param {remoting.Error} errorTag The error to be localized and displayed. | 275 * @param {remoting.Error} errorTag The error to be localized and displayed. |
| 276 * @return {void} Nothing. | 276 * @return {void} Nothing. |
| 277 */ | 277 */ |
| 278 remoting.DesktopRemoting.prototype.handleError = function(errorTag) { | 278 remoting.DesktopRemoting.prototype.handleError = function(errorTag) { |
| 279 console.error('Connection failed: ' + errorTag); | 279 console.error('Connection failed: ' + errorTag); |
| 280 remoting.accessCode = ''; | 280 remoting.accessCode = ''; |
| 281 | 281 |
| 282 if (errorTag === remoting.Error.AUTHENTICATION_FAILED) { | |
| 283 remoting.setMode(remoting.AppMode.HOME); | |
|
Jamie
2015/01/23 23:33:26
We should still show an error in this case. Would
kelvinp
2015/01/28 00:26:45
Ya, it would be some work to show the error cleanl
| |
| 284 remoting.identity.handleAuthFailureAndRelaunch(); | |
| 285 return; | |
| 286 } | |
| 287 | |
| 282 // Reset the refresh flag so that the next connection will retry if needed. | 288 // Reset the refresh flag so that the next connection will retry if needed. |
| 283 this.refreshHostJidIfOffline_ = true; | 289 this.refreshHostJidIfOffline_ = true; |
| 284 | 290 |
| 285 var errorDiv = document.getElementById('connect-error-message'); | 291 var errorDiv = document.getElementById('connect-error-message'); |
| 286 l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag)); | 292 l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag)); |
| 287 | 293 |
| 288 var mode = remoting.clientSession ? remoting.clientSession.getMode() | 294 var mode = remoting.clientSession ? remoting.clientSession.getMode() |
| 289 : this.app_.getSessionConnector().getConnectionMode(); | 295 : this.app_.getSessionConnector().getConnectionMode(); |
| 290 if (mode == remoting.ClientSession.Mode.IT2ME) { | 296 if (mode == remoting.ClientSession.Mode.IT2ME) { |
| 291 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); | 297 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); |
| 292 remoting.hangoutSessionEvents.raiseEvent( | 298 remoting.hangoutSessionEvents.raiseEvent( |
| 293 remoting.hangoutSessionEvents.sessionStateChanged, | 299 remoting.hangoutSessionEvents.sessionStateChanged, |
| 294 remoting.ClientSession.State.FAILED | 300 remoting.ClientSession.State.FAILED |
| 295 ); | 301 ); |
| 296 } else { | 302 } else { |
| 297 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); | 303 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |
| 298 } | 304 } |
| 299 }; | 305 }; |
| OLD | NEW |