Chromium Code Reviews| 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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 619 remoting.ClientSession.prototype.disconnect = function(error) { | 619 remoting.ClientSession.prototype.disconnect = function(error) { |
| 620 var state = (error == remoting.Error.NONE) ? | 620 var state = (error == remoting.Error.NONE) ? |
| 621 remoting.ClientSession.State.CLOSED : | 621 remoting.ClientSession.State.CLOSED : |
| 622 remoting.ClientSession.State.FAILED; | 622 remoting.ClientSession.State.FAILED; |
| 623 | 623 |
| 624 // The plugin won't send a state change notification, so we explicitly log | 624 // The plugin won't send a state change notification, so we explicitly log |
| 625 // the fact that the connection has closed. | 625 // the fact that the connection has closed. |
| 626 this.logToServer.logClientSessionStateChange(state, error); | 626 this.logToServer.logClientSessionStateChange(state, error); |
| 627 this.error_ = error; | 627 this.error_ = error; |
| 628 this.setState_(state); | 628 this.setState_(state); |
| 629 remoting.app.onDisconnected(); | |
| 629 }; | 630 }; |
| 630 | 631 |
| 631 /** | 632 /** |
| 632 * Deletes the <embed> element from the container and disconnects. | 633 * Deletes the <embed> element from the container and disconnects. |
| 633 * | 634 * |
| 634 * @return {void} Nothing. | 635 * @return {void} Nothing. |
| 635 */ | 636 */ |
| 636 remoting.ClientSession.prototype.cleanup = function() { | 637 remoting.ClientSession.prototype.cleanup = function() { |
| 637 this.sendIq_( | 638 this.sendIq_( |
| 638 '<cli:iq ' + | 639 '<cli:iq ' + |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1273 // TODO(wez): Handle high-DPI to high-DPI properly (crbug.com/135089). | 1274 // TODO(wez): Handle high-DPI to high-DPI properly (crbug.com/135089). |
| 1274 this.plugin_.element().style.width = pluginWidth + 'px'; | 1275 this.plugin_.element().style.width = pluginWidth + 'px'; |
| 1275 this.plugin_.element().style.height = pluginHeight + 'px'; | 1276 this.plugin_.element().style.height = pluginHeight + 'px'; |
| 1276 | 1277 |
| 1277 // Position the container. | 1278 // Position the container. |
| 1278 // Note that clientWidth/Height take into account scrollbars. | 1279 // Note that clientWidth/Height take into account scrollbars. |
| 1279 var clientWidth = document.documentElement.clientWidth; | 1280 var clientWidth = document.documentElement.clientWidth; |
| 1280 var clientHeight = document.documentElement.clientHeight; | 1281 var clientHeight = document.documentElement.clientHeight; |
| 1281 var parentNode = this.plugin_.element().parentNode; | 1282 var parentNode = this.plugin_.element().parentNode; |
| 1282 | 1283 |
| 1284 // When we receive the first plugin dimensions from the host, we know that | |
| 1285 // remote host has started. | |
|
Jamie
2014/12/06 01:57:59
s/remote host/the video stream/
Also, please move
garykac
2014/12/06 02:15:50
Done.
| |
| 1286 remoting.app.onVideoStreamingStarted(); | |
| 1287 | |
| 1283 console.log('plugin dimensions: ' + | 1288 console.log('plugin dimensions: ' + |
| 1284 parentNode.style.left + ',' + | 1289 parentNode.style.left + ',' + |
| 1285 parentNode.style.top + '-' + | 1290 parentNode.style.top + '-' + |
| 1286 pluginWidth + 'x' + pluginHeight + '.'); | 1291 pluginWidth + 'x' + pluginHeight + '.'); |
| 1287 }; | 1292 }; |
| 1288 | 1293 |
| 1289 /** | 1294 /** |
| 1290 * Returns an associative array with a set of stats for this connection. | 1295 * Returns an associative array with a set of stats for this connection. |
| 1291 * | 1296 * |
| 1292 * @return {remoting.ClientSession.PerfStats} The connection statistics. | 1297 * @return {remoting.ClientSession.PerfStats} The connection statistics. |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1634 * @param {string} data Contents of the extension message. | 1639 * @param {string} data Contents of the extension message. |
| 1635 * @return {boolean} True if the message was recognized, false otherwise. | 1640 * @return {boolean} True if the message was recognized, false otherwise. |
| 1636 */ | 1641 */ |
| 1637 remoting.ClientSession.prototype.handleExtensionMessage = | 1642 remoting.ClientSession.prototype.handleExtensionMessage = |
| 1638 function(type, data) { | 1643 function(type, data) { |
| 1639 if (this.videoFrameRecorder_) { | 1644 if (this.videoFrameRecorder_) { |
| 1640 return this.videoFrameRecorder_.handleMessage(type, data); | 1645 return this.videoFrameRecorder_.handleMessage(type, data); |
| 1641 } | 1646 } |
| 1642 return false; | 1647 return false; |
| 1643 } | 1648 } |
| OLD | NEW |