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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 retryConnectOrReportOffline_(); | 230 retryConnectOrReportOffline_(); |
231 } else if (remoting.clientSession.error == | 231 } else if (remoting.clientSession.error == |
232 remoting.ClientSession.ConnectionError.SESSION_REJECTED) { | 232 remoting.ClientSession.ConnectionError.SESSION_REJECTED) { |
233 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); | 233 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); |
234 } else if (remoting.clientSession.error == | 234 } else if (remoting.clientSession.error == |
235 remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL) { | 235 remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL) { |
236 showConnectError_(remoting.Error.INCOMPATIBLE_PROTOCOL); | 236 showConnectError_(remoting.Error.INCOMPATIBLE_PROTOCOL); |
237 } else if (remoting.clientSession.error == | 237 } else if (remoting.clientSession.error == |
238 remoting.ClientSession.ConnectionError.NETWORK_FAILURE) { | 238 remoting.ClientSession.ConnectionError.NETWORK_FAILURE) { |
239 showConnectError_(remoting.Error.NETWORK_FAILURE); | 239 showConnectError_(remoting.Error.NETWORK_FAILURE); |
| 240 } else if (remoting.clientSession.error == |
| 241 remoting.ClientSession.ConnectionError.HOST_IS_DISABLED) { |
| 242 showConnectError_(remoting.Error.HOST_IS_DISABLED); |
240 } else { | 243 } else { |
241 showConnectError_(remoting.Error.GENERIC); | 244 showConnectError_(remoting.Error.GENERIC); |
242 } | 245 } |
243 | 246 |
244 if (clearPin) { | 247 if (clearPin) { |
245 document.getElementById('pin-entry').value = ''; | 248 document.getElementById('pin-entry').value = ''; |
246 } | 249 } |
247 | 250 |
248 } else { | 251 } else { |
249 console.error('Unexpected client plugin state: ' + newState); | 252 console.error('Unexpected client plugin state: ' + newState); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 pin, 'spake2_hmac,spake2_plain', remoting.hostId, | 509 pin, 'spake2_hmac,spake2_plain', remoting.hostId, |
507 /** @type {string} */ (remoting.oauth2.getCachedEmail()), | 510 /** @type {string} */ (remoting.oauth2.getCachedEmail()), |
508 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); | 511 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); |
509 remoting.clientSession.createPluginAndConnect( | 512 remoting.clientSession.createPluginAndConnect( |
510 document.getElementById('session-mode'), | 513 document.getElementById('session-mode'), |
511 token); | 514 token); |
512 } else { | 515 } else { |
513 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); | 516 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); |
514 } | 517 } |
515 } | 518 } |
OLD | NEW |