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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 remoting.ClientSession.prototype.disconnect = function(error) { | 636 remoting.ClientSession.prototype.disconnect = function(error) { |
637 var state = (error == remoting.Error.NONE) ? | 637 var state = (error == remoting.Error.NONE) ? |
638 remoting.ClientSession.State.CLOSED : | 638 remoting.ClientSession.State.CLOSED : |
639 remoting.ClientSession.State.FAILED; | 639 remoting.ClientSession.State.FAILED; |
640 | 640 |
641 // The plugin won't send a state change notification, so we explicitly log | 641 // The plugin won't send a state change notification, so we explicitly log |
642 // the fact that the connection has closed. | 642 // the fact that the connection has closed. |
643 this.logToServer.logClientSessionStateChange(state, error); | 643 this.logToServer.logClientSessionStateChange(state, error); |
644 this.error_ = error; | 644 this.error_ = error; |
645 this.setState_(state); | 645 this.setState_(state); |
| 646 remoting.app.onDisconnected(); |
646 }; | 647 }; |
647 | 648 |
648 /** | 649 /** |
649 * Deletes the <embed> element from the container and disconnects. | 650 * Deletes the <embed> element from the container and disconnects. |
650 * | 651 * |
651 * @return {void} Nothing. | 652 * @return {void} Nothing. |
652 */ | 653 */ |
653 remoting.ClientSession.prototype.cleanup = function() { | 654 remoting.ClientSession.prototype.cleanup = function() { |
654 this.sendIq_( | 655 this.sendIq_( |
655 '<cli:iq ' + | 656 '<cli:iq ' + |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 // Position the container. | 1288 // Position the container. |
1288 // Note that clientWidth/Height take into account scrollbars. | 1289 // Note that clientWidth/Height take into account scrollbars. |
1289 var clientWidth = document.documentElement.clientWidth; | 1290 var clientWidth = document.documentElement.clientWidth; |
1290 var clientHeight = document.documentElement.clientHeight; | 1291 var clientHeight = document.documentElement.clientHeight; |
1291 var parentNode = this.plugin_.element().parentNode; | 1292 var parentNode = this.plugin_.element().parentNode; |
1292 | 1293 |
1293 console.log('plugin dimensions: ' + | 1294 console.log('plugin dimensions: ' + |
1294 parentNode.style.left + ',' + | 1295 parentNode.style.left + ',' + |
1295 parentNode.style.top + '-' + | 1296 parentNode.style.top + '-' + |
1296 pluginWidth + 'x' + pluginHeight + '.'); | 1297 pluginWidth + 'x' + pluginHeight + '.'); |
| 1298 |
| 1299 // When we receive the first plugin dimensions from the host, we know that |
| 1300 // remote host has started. |
| 1301 remoting.app.onVideoStreamingStarted(); |
1297 }; | 1302 }; |
1298 | 1303 |
1299 /** | 1304 /** |
1300 * Returns an associative array with a set of stats for this connection. | 1305 * Returns an associative array with a set of stats for this connection. |
1301 * | 1306 * |
1302 * @return {remoting.ClientSession.PerfStats} The connection statistics. | 1307 * @return {remoting.ClientSession.PerfStats} The connection statistics. |
1303 */ | 1308 */ |
1304 remoting.ClientSession.prototype.getPerfStats = function() { | 1309 remoting.ClientSession.prototype.getPerfStats = function() { |
1305 return this.plugin_.getPerfStats(); | 1310 return this.plugin_.getPerfStats(); |
1306 }; | 1311 }; |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1644 * @param {string} data Contents of the extension message. | 1649 * @param {string} data Contents of the extension message. |
1645 * @return {boolean} True if the message was recognized, false otherwise. | 1650 * @return {boolean} True if the message was recognized, false otherwise. |
1646 */ | 1651 */ |
1647 remoting.ClientSession.prototype.handleExtensionMessage = | 1652 remoting.ClientSession.prototype.handleExtensionMessage = |
1648 function(type, data) { | 1653 function(type, data) { |
1649 if (this.videoFrameRecorder_) { | 1654 if (this.videoFrameRecorder_) { |
1650 return this.videoFrameRecorder_.handleMessage(type, data); | 1655 return this.videoFrameRecorder_.handleMessage(type, data); |
1651 } | 1656 } |
1652 return false; | 1657 return false; |
1653 } | 1658 } |
OLD | NEW |