OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * Session class that handles creation and teardown of a remoting session. | 7 * Session class that handles creation and teardown of a remoting session. |
8 * | 8 * |
9 * This abstracts a <embed> element and controls the plugin which does the | 9 * This abstracts a <embed> element and controls the plugin which does the |
10 * actual remoting work. There should be no UI code inside this class. It | 10 * actual remoting work. There should be no UI code inside this class. It |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 remoting.debug.log('scale up is not supported'); | 388 remoting.debug.log('scale up is not supported'); |
389 scale = 1.0; | 389 scale = 1.0; |
390 } | 390 } |
391 | 391 |
392 this.plugin.width = this.plugin.desktopWidth * scale; | 392 this.plugin.width = this.plugin.desktopWidth * scale; |
393 this.plugin.height = this.plugin.desktopHeight * scale; | 393 this.plugin.height = this.plugin.desktopHeight * scale; |
394 } else { | 394 } else { |
395 this.plugin.width = this.plugin.desktopWidth; | 395 this.plugin.width = this.plugin.desktopWidth; |
396 this.plugin.height = this.plugin.desktopHeight; | 396 this.plugin.height = this.plugin.desktopHeight; |
397 } | 397 } |
398 remoting.debug.log('window size is now: ' + | |
399 window.innerWidth + ' x ' + window.innerHeight + '.'); | |
400 remoting.debug.log('plugin size is now: ' + | 398 remoting.debug.log('plugin size is now: ' + |
401 this.plugin.width + ' x ' + this.plugin.height + '.'); | 399 this.plugin.width + ' x ' + this.plugin.height + '.'); |
402 this.plugin.setScaleToFit(shouldScale); | 400 this.plugin.setScaleToFit(shouldScale); |
403 if (shouldScale) { | |
404 addClass(document.all[0], 'hide-scrollbars'); | |
405 } else { | |
406 removeClass(document.all[0], 'hide-scrollbars'); | |
407 } | |
408 remoting.debug.log('scale to fit is now: ' + shouldScale); | 401 remoting.debug.log('scale to fit is now: ' + shouldScale); |
409 }; | 402 }; |
410 | 403 |
411 /** | 404 /** |
412 * Returns an associative array with a set of stats for this connection. | 405 * Returns an associative array with a set of stats for this connection. |
413 * | 406 * |
414 * @return {Object} The connection statistics. | 407 * @return {Object} The connection statistics. |
415 */ | 408 */ |
416 remoting.ClientSession.prototype.stats = function() { | 409 remoting.ClientSession.prototype.stats = function() { |
417 return { | 410 return { |
418 'video_bandwidth': this.plugin.videoBandwidth, | 411 'video_bandwidth': this.plugin.videoBandwidth, |
419 'capture_latency': this.plugin.videoCaptureLatency, | 412 'capture_latency': this.plugin.videoCaptureLatency, |
420 'encode_latency': this.plugin.videoEncodeLatency, | 413 'encode_latency': this.plugin.videoEncodeLatency, |
421 'decode_latency': this.plugin.videoDecodeLatency, | 414 'decode_latency': this.plugin.videoDecodeLatency, |
422 'render_latency': this.plugin.videoRenderLatency, | 415 'render_latency': this.plugin.videoRenderLatency, |
423 'roundtrip_latency': this.plugin.roundTripLatency | 416 'roundtrip_latency': this.plugin.roundTripLatency |
424 }; | 417 }; |
425 }; | 418 }; |
426 | 419 |
427 }()); | 420 }()); |
OLD | NEW |