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 + '.'); |
398 remoting.debug.log('plugin size is now: ' + | 400 remoting.debug.log('plugin size is now: ' + |
399 this.plugin.width + ' x ' + this.plugin.height + '.'); | 401 this.plugin.width + ' x ' + this.plugin.height + '.'); |
400 this.plugin.setScaleToFit(shouldScale); | 402 this.plugin.setScaleToFit(shouldScale); |
| 403 if (shouldScale) { |
| 404 addClass(document.all[0], 'hide-scrollbars'); |
| 405 } else { |
| 406 removeClass(document.all[0], 'hide-scrollbars'); |
| 407 } |
401 remoting.debug.log('scale to fit is now: ' + shouldScale); | 408 remoting.debug.log('scale to fit is now: ' + shouldScale); |
402 }; | 409 }; |
403 | 410 |
404 /** | 411 /** |
405 * Returns an associative array with a set of stats for this connection. | 412 * Returns an associative array with a set of stats for this connection. |
406 * | 413 * |
407 * @return {Object} The connection statistics. | 414 * @return {Object} The connection statistics. |
408 */ | 415 */ |
409 remoting.ClientSession.prototype.stats = function() { | 416 remoting.ClientSession.prototype.stats = function() { |
410 return { | 417 return { |
411 'video_bandwidth': this.plugin.videoBandwidth, | 418 'video_bandwidth': this.plugin.videoBandwidth, |
412 'capture_latency': this.plugin.videoCaptureLatency, | 419 'capture_latency': this.plugin.videoCaptureLatency, |
413 'encode_latency': this.plugin.videoEncodeLatency, | 420 'encode_latency': this.plugin.videoEncodeLatency, |
414 'decode_latency': this.plugin.videoDecodeLatency, | 421 'decode_latency': this.plugin.videoDecodeLatency, |
415 'render_latency': this.plugin.videoRenderLatency, | 422 'render_latency': this.plugin.videoRenderLatency, |
416 'roundtrip_latency': this.plugin.roundTripLatency | 423 'roundtrip_latency': this.plugin.roundTripLatency |
417 }; | 424 }; |
418 }; | 425 }; |
419 | 426 |
420 }()); | 427 }()); |
OLD | NEW |