| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 }; | 314 }; |
| 315 | 315 |
| 316 /** | 316 /** |
| 317 * @param {remoting.Error} error | 317 * @param {remoting.Error} error |
| 318 */ | 318 */ |
| 319 remoting.ClientSession.prototype.resetWithError_ = function(error) { | 319 remoting.ClientSession.prototype.resetWithError_ = function(error) { |
| 320 this.signalStrategy_.setIncomingStanzaCallback(null); | 320 this.signalStrategy_.setIncomingStanzaCallback(null); |
| 321 this.removePlugin(); | 321 this.removePlugin(); |
| 322 this.error_ = error; | 322 this.error_ = error; |
| 323 this.setState_(remoting.ClientSession.State.FAILED); | 323 this.setState_(remoting.ClientSession.State.FAILED); |
| 324 } | 324 }; |
| 325 | 325 |
| 326 /** | 326 /** |
| 327 * Deletes the <embed> element from the container, without sending a | 327 * Deletes the <embed> element from the container, without sending a |
| 328 * session_terminate request. This is to be called when the session was | 328 * session_terminate request. This is to be called when the session was |
| 329 * disconnected by the Host. | 329 * disconnected by the Host. |
| 330 * | 330 * |
| 331 * @return {void} Nothing. | 331 * @return {void} Nothing. |
| 332 */ | 332 */ |
| 333 remoting.ClientSession.prototype.removePlugin = function() { | 333 remoting.ClientSession.prototype.removePlugin = function() { |
| 334 this.uiHandler_.removePlugin(); | 334 this.uiHandler_.removePlugin(); |
| 335 this.plugin_ = null; | 335 this.plugin_ = null; |
| 336 remoting.desktopConnectedView = null; |
| 336 }; | 337 }; |
| 337 | 338 |
| 338 /** | 339 /** |
| 339 * Disconnect the current session with a particular |error|. The session will | 340 * Disconnect the current session with a particular |error|. The session will |
| 340 * raise a |stateChanged| event in response to it. The caller should then call | 341 * raise a |stateChanged| event in response to it. The caller should then call |
| 341 * |cleanup| to remove and destroy the <embed> element. | 342 * |cleanup| to remove and destroy the <embed> element. |
| 342 * | 343 * |
| 343 * @param {remoting.Error} error The reason for the disconnection. Use | 344 * @param {remoting.Error} error The reason for the disconnection. Use |
| 344 * remoting.Error.NONE if there is no error. | 345 * remoting.Error.NONE if there is no error. |
| 345 * @return {void} Nothing. | 346 * @return {void} Nothing. |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 * @param {boolean} enable True to enable rendering. | 843 * @param {boolean} enable True to enable rendering. |
| 843 */ | 844 */ |
| 844 remoting.ClientSession.prototype.enableDebugRegion = function(enable) { | 845 remoting.ClientSession.prototype.enableDebugRegion = function(enable) { |
| 845 if (enable) { | 846 if (enable) { |
| 846 this.plugin_.setDebugDirtyRegionHandler( | 847 this.plugin_.setDebugDirtyRegionHandler( |
| 847 this.uiHandler_.handleDebugRegion.bind(this.uiHandler_)); | 848 this.uiHandler_.handleDebugRegion.bind(this.uiHandler_)); |
| 848 } else { | 849 } else { |
| 849 this.plugin_.setDebugDirtyRegionHandler(null); | 850 this.plugin_.setDebugDirtyRegionHandler(null); |
| 850 } | 851 } |
| 851 } | 852 } |
| OLD | NEW |