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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 clearPin = false; | 240 clearPin = false; |
241 retryConnectOrReportOffline_(); | 241 retryConnectOrReportOffline_(); |
242 } else if (remoting.clientSession.error == | 242 } else if (remoting.clientSession.error == |
243 remoting.ClientSession.ConnectionError.SESSION_REJECTED) { | 243 remoting.ClientSession.ConnectionError.SESSION_REJECTED) { |
244 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); | 244 showConnectError_(remoting.Error.INVALID_ACCESS_CODE); |
245 } else if (remoting.clientSession.error == | 245 } else if (remoting.clientSession.error == |
246 remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL) { | 246 remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL) { |
247 showConnectError_(remoting.Error.INCOMPATIBLE_PROTOCOL); | 247 showConnectError_(remoting.Error.INCOMPATIBLE_PROTOCOL); |
248 } else if (remoting.clientSession.error == | 248 } else if (remoting.clientSession.error == |
249 remoting.ClientSession.ConnectionError.NETWORK_FAILURE) { | 249 remoting.ClientSession.ConnectionError.NETWORK_FAILURE) { |
250 showConnectError_(remoting.Error.GENERIC); | 250 showConnectError_(remoting.Error.NETWORK_FAILURE); |
251 } else { | 251 } else { |
252 showConnectError_(remoting.Error.GENERIC); | 252 showConnectError_(remoting.Error.GENERIC); |
253 } | 253 } |
254 | 254 |
255 if (clearPin) { | 255 if (clearPin) { |
256 document.getElementById('pin-entry').value = ''; | 256 document.getElementById('pin-entry').value = ''; |
257 } | 257 } |
258 | 258 |
259 } else { | 259 } else { |
260 console.error('Unexpected client plugin state: ' + newState); | 260 console.error('Unexpected client plugin state: ' + newState); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 /** @type {string} */ (remoting.oauth2.getCachedEmail()), | 502 /** @type {string} */ (remoting.oauth2.getCachedEmail()), |
503 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); | 503 remoting.ClientSession.Mode.ME2ME, onClientStateChange_); |
504 remoting.clientSession.createPluginAndConnect( | 504 remoting.clientSession.createPluginAndConnect( |
505 document.getElementById('session-mode'), | 505 document.getElementById('session-mode'), |
506 token); | 506 token); |
507 remoting.setScaleToFit(remoting.clientSession.getScaleToFit()); | 507 remoting.setScaleToFit(remoting.clientSession.getScaleToFit()); |
508 } else { | 508 } else { |
509 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); | 509 showConnectError_(remoting.Error.AUTHENTICATION_FAILED); |
510 } | 510 } |
511 } | 511 } |
OLD | NEW |