| 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 * Class handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client session. |
| 8 * | 8 * |
| 9 * The ClientSession class controls lifetime of the client plugin | 9 * The ClientSession class controls lifetime of the client plugin |
| 10 * object and provides the plugin with the functionality it needs to | 10 * object and provides the plugin with the functionality it needs to |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 * Callback that the plugin invokes to indicate that the connection | 383 * Callback that the plugin invokes to indicate that the connection |
| 384 * status has changed. | 384 * status has changed. |
| 385 * | 385 * |
| 386 * @param {remoting.ClientSession.State} status The plugin's status. | 386 * @param {remoting.ClientSession.State} status The plugin's status. |
| 387 * @param {remoting.ClientSession.ConnectionError} error The plugin's error | 387 * @param {remoting.ClientSession.ConnectionError} error The plugin's error |
| 388 * state, if any. | 388 * state, if any. |
| 389 */ | 389 */ |
| 390 remoting.ClientSession.prototype.onConnectionStatusUpdate = | 390 remoting.ClientSession.prototype.onConnectionStatusUpdate = |
| 391 function(status, error) { | 391 function(status, error) { |
| 392 if (status == remoting.ClientSession.State.CONNECTED) { | 392 if (status == remoting.ClientSession.State.CONNECTED) { |
| 393 remoting.desktopConnectedView.updateClientSessionUi_(this); | 393 remoting.desktopConnectedView.onConnected(); |
| 394 | |
| 395 } else if (status == remoting.ClientSession.State.FAILED) { | 394 } else if (status == remoting.ClientSession.State.FAILED) { |
| 396 switch (error) { | 395 switch (error) { |
| 397 case remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE: | 396 case remoting.ClientSession.ConnectionError.HOST_IS_OFFLINE: |
| 398 this.error_ = remoting.Error.HOST_IS_OFFLINE; | 397 this.error_ = remoting.Error.HOST_IS_OFFLINE; |
| 399 break; | 398 break; |
| 400 case remoting.ClientSession.ConnectionError.SESSION_REJECTED: | 399 case remoting.ClientSession.ConnectionError.SESSION_REJECTED: |
| 401 this.error_ = remoting.Error.INVALID_ACCESS_CODE; | 400 this.error_ = remoting.Error.INVALID_ACCESS_CODE; |
| 402 break; | 401 break; |
| 403 case remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL: | 402 case remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL: |
| 404 this.error_ = remoting.Error.INCOMPATIBLE_PROTOCOL; | 403 this.error_ = remoting.Error.INCOMPATIBLE_PROTOCOL; |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 */ | 707 */ |
| 709 remoting.ClientSession.prototype.enableDebugRegion = function(enable) { | 708 remoting.ClientSession.prototype.enableDebugRegion = function(enable) { |
| 710 if (enable) { | 709 if (enable) { |
| 711 this.plugin_.setDebugDirtyRegionHandler( | 710 this.plugin_.setDebugDirtyRegionHandler( |
| 712 remoting.desktopConnectedView.handleDebugRegion.bind( | 711 remoting.desktopConnectedView.handleDebugRegion.bind( |
| 713 remoting.desktopConnectedView)); | 712 remoting.desktopConnectedView)); |
| 714 } else { | 713 } else { |
| 715 this.plugin_.setDebugDirtyRegionHandler(null); | 714 this.plugin_.setDebugDirtyRegionHandler(null); |
| 716 } | 715 } |
| 717 } | 716 } |
| OLD | NEW |