Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Side by Side Diff: remoting/webapp/crd/js/desktop_remoting.js

Issue 868203002: Handle authentication failures in the v2 app by restarting the app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CL feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698