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

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: Rebase 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
« no previous file with comments | « remoting/webapp/crd/js/crd_event_handlers.js ('k') | remoting/webapp/crd/js/host_list.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 /** 299 /**
300 * Called when an error needs to be displayed to the user. 300 * Called when an error needs to be displayed to the user.
301 * 301 *
302 * @param {remoting.Error} errorTag The error to be localized and displayed. 302 * @param {remoting.Error} errorTag The error to be localized and displayed.
303 * @return {void} Nothing. 303 * @return {void} Nothing.
304 */ 304 */
305 remoting.DesktopRemoting.prototype.handleError = function(errorTag) { 305 remoting.DesktopRemoting.prototype.handleError = function(errorTag) {
306 console.error('Connection failed: ' + errorTag); 306 console.error('Connection failed: ' + errorTag);
307 remoting.accessCode = ''; 307 remoting.accessCode = '';
308 308
309 if (errorTag === remoting.Error.AUTHENTICATION_FAILED) {
310 remoting.setMode(remoting.AppMode.HOME);
311 remoting.handleAuthFailureAndRelaunch();
312 return;
313 }
314
309 // Reset the refresh flag so that the next connection will retry if needed. 315 // Reset the refresh flag so that the next connection will retry if needed.
310 this.refreshHostJidIfOffline_ = true; 316 this.refreshHostJidIfOffline_ = true;
311 317
312 var errorDiv = document.getElementById('connect-error-message'); 318 var errorDiv = document.getElementById('connect-error-message');
313 l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag)); 319 l10n.localizeElementFromTag(errorDiv, /** @type {string} */ (errorTag));
314 320
315 var mode = remoting.clientSession ? remoting.clientSession.getMode() 321 var mode = remoting.clientSession ? remoting.clientSession.getMode()
316 : this.app_.getSessionConnector().getConnectionMode(); 322 : this.app_.getSessionConnector().getConnectionMode();
317 if (mode == remoting.ClientSession.Mode.IT2ME) { 323 if (mode == remoting.ClientSession.Mode.IT2ME) {
318 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME); 324 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_IT2ME);
319 remoting.hangoutSessionEvents.raiseEvent( 325 remoting.hangoutSessionEvents.raiseEvent(
320 remoting.hangoutSessionEvents.sessionStateChanged, 326 remoting.hangoutSessionEvents.sessionStateChanged,
321 remoting.ClientSession.State.FAILED 327 remoting.ClientSession.State.FAILED
322 ); 328 );
323 } else { 329 } else {
324 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME); 330 remoting.setMode(remoting.AppMode.CLIENT_CONNECT_FAILED_ME2ME);
325 } 331 }
326 }; 332 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/js/crd_event_handlers.js ('k') | remoting/webapp/crd/js/host_list.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698