| 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Functions related to the 'client screen' for Chromoting. | 7 * Functions related to the 'client screen' for Chromoting. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 } else { | 240 } else { |
| 241 // The transition from CONNECTING to CLOSED state may happen | 241 // The transition from CONNECTING to CLOSED state may happen |
| 242 // only with older client plugins. Current version should go the | 242 // only with older client plugins. Current version should go the |
| 243 // FAILED state when connection fails. | 243 // FAILED state when connection fails. |
| 244 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); | 244 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } else if (newState == remoting.ClientSession.State.FAILED) { | 247 } else if (newState == remoting.ClientSession.State.FAILED) { |
| 248 console.error('Client plugin reported connection failed: ' + | 248 console.error('Client plugin reported connection failed: ' + |
| 249 remoting.clientSession.error); | 249 remoting.clientSession.error); |
| 250 clearPin = true; | 250 clearPin = true; |
| 251 if (remoting.clientSession.error == | 251 if (remoting.clientSession.error == |
| 252 remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE) { | 252 remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE) { |
| 253 clearPin = false; | 253 clearPin = false; |
| 254 retryConnectOrReportOffline_(); | 254 retryConnectOrReportOffline_(); |
| 255 } else if (remoting.clientSession.error == | 255 } else if (remoting.clientSession.error == |
| 256 remoting.ClientSession.ConnectionError.SESSION_REJECTED) { | 256 remoting.ClientSession.ConnectionError.SESSION_REJECTED) { |
| 257 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); | 257 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); |
| 258 } else if (remoting.clientSession.error == | 258 } else if (remoting.clientSession.error == |
| 259 remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL) { | 259 remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL) { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 if (token) { | 523 if (token) { |
| 524 /** @type {string} */ | 524 /** @type {string} */ |
| 525 var pin = document.getElementById('pin-entry').value; | 525 var pin = document.getElementById('pin-entry').value; |
| 526 | 526 |
| 527 remoting.clientSession = | 527 remoting.clientSession = |
| 528 new remoting.ClientSession( | 528 new remoting.ClientSession( |
| 529 remoting.hostJid, remoting.hostPublicKey, | 529 remoting.hostJid, remoting.hostPublicKey, |
| 530 pin, 'spake2_hmac,spake2_plain', remoting.hostId, | 530 pin, 'spake2_hmac,spake2_plain', remoting.hostId, |
| 531 /** @type {string} */ (remoting.oauth2.getCachedEmail()), | 531 /** @type {string} */ (remoting.oauth2.getCachedEmail()), |
| 532 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); | 532 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); |
| 533 // Don't log errors for cached JIDs. |
| 534 remoting.clientSession.logErrors(!remoting.retryIfOffline); |
| 533 remoting.clientSession.createPluginAndConnect( | 535 remoting.clientSession.createPluginAndConnect( |
| 534 document.getElementById('session-mode'), | 536 document.getElementById('session-mode'), |
| 535 token); | 537 token); |
| 536 } else { | 538 } else { |
| 537 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); | 539 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); |
| 538 } | 540 } |
| 539 } | 541 } |
| OLD | NEW |