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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 /** | 271 /** |
272 * Called when an error needs to be displayed to the user. | 272 * Called when an error needs to be displayed to the user. |
273 * | 273 * |
274 * @param {remoting.Error} errorTag The error to be localized and displayed. | 274 * @param {remoting.Error} errorTag The error to be localized and displayed. |
275 * @return {void} Nothing. | 275 * @return {void} Nothing. |
276 */ | 276 */ |
277 remoting.DesktopRemoting.prototype.handleError = function(errorTag) { | 277 remoting.DesktopRemoting.prototype.handleError = function(errorTag) { |
278 console.error('Connection failed: ' + errorTag); | 278 console.error('Connection failed: ' + errorTag); |
279 remoting.accessCode = ''; | 279 remoting.accessCode = ''; |
280 | 280 |
| 281 if (errorTag === remoting.Error.AUTHENTICATION_FAILED) { |
| 282 remoting.setMode(remoting.AppMode.HOME); |
| 283 remoting.handleAuthFailureAndRelaunch(); |
| 284 return; |
| 285 } |
| 286 |
281 // Reset the refresh flag so that the next connection will retry if needed. | 287 // Reset the refresh flag so that the next connection will retry if needed. |
282 this.refreshHostJidIfOffline_ = true; | 288 this.refreshHostJidIfOffline_ = true; |
283 | 289 |
284 var errorDiv = document.getElementById('connect-error-message'); | 290 var errorDiv = document.getElementById('connect-error-message'); |
285 l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag)); | 291 l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag)); |
286 | 292 |
287 var mode = remoting.clientSession ? remoting.clientSession.getMode() | 293 var mode = remoting.clientSession ? remoting.clientSession.getMode() |
288 : this.app_.getSessionConnector().getConnectionMode(); | 294 : this.app_.getSessionConnector().getConnectionMode(); |
289 if (mode == remoting.ClientSession.Mode.IT2ME) { | 295 if (mode == remoting.ClientSession.Mode.IT2ME) { |
290 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); | 296 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); |
291 remoting.hangoutSessionEvents.raiseEvent( | 297 remoting.hangoutSessionEvents.raiseEvent( |
292 remoting.hangoutSessionEvents.sessionStateChanged, | 298 remoting.hangoutSessionEvents.sessionStateChanged, |
293 remoting.ClientSession.State.FAILED | 299 remoting.ClientSession.State.FAILED |
294 ); | 300 ); |
295 } else { | 301 } else { |
296 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); | 302 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); |
297 } | 303 } |
298 }; | 304 }; |
OLD | NEW |