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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
436 */ | 436 */ |
437 remoting.ClientSession.prototype.updateDimensions = function() { | 437 remoting.ClientSession.prototype.updateDimensions = function() { |
438 if (this.plugin.desktopWidth == 0 || | 438 if (this.plugin.desktopWidth == 0 || |
439 this.plugin.desktopHeight == 0) { | 439 this.plugin.desktopHeight == 0) { |
440 return; | 440 return; |
441 } | 441 } |
442 | 442 |
443 var windowWidth = window.innerWidth; | 443 var windowWidth = window.innerWidth; |
444 var windowHeight = window.innerHeight; | 444 var windowHeight = window.innerHeight; |
445 var scale = 1.0; | 445 var scale = 1.0; |
446 | |
Wez
2012/02/23 22:59:26
nit: Looks like this file didn't get reverted clea
alexeypa (please no reviews)
2012/02/23 23:59:14
Done.
| |
447 if (this.getScaleToFit()) { | 446 if (this.getScaleToFit()) { |
448 var scaleFitWidth = 1.0 * windowWidth / this.plugin.desktopWidth; | 447 var scaleFitWidth = 1.0 * windowWidth / this.plugin.desktopWidth; |
449 var scaleFitHeight = 1.0 * windowHeight / this.plugin.desktopHeight; | 448 var scaleFitHeight = 1.0 * windowHeight / this.plugin.desktopHeight; |
450 scale = Math.min(1.0, scaleFitHeight, scaleFitWidth); | 449 scale = Math.min(1.0, scaleFitHeight, scaleFitWidth); |
451 } | 450 } |
452 | 451 |
453 var width = this.plugin.desktopWidth * scale; | 452 var width = this.plugin.desktopWidth * scale; |
454 var height = this.plugin.desktopHeight * scale; | 453 var height = this.plugin.desktopHeight * scale; |
455 | 454 |
456 // Resize the plugin if necessary. | 455 // Resize the plugin if necessary. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
490 }; | 489 }; |
491 | 490 |
492 /** | 491 /** |
493 * Logs statistics. | 492 * Logs statistics. |
494 * | 493 * |
495 * @param {remoting.ClientSession.PerfStats} stats | 494 * @param {remoting.ClientSession.PerfStats} stats |
496 */ | 495 */ |
497 remoting.ClientSession.prototype.logStatistics = function(stats) { | 496 remoting.ClientSession.prototype.logStatistics = function(stats) { |
498 this.logToServer.logStatistics(stats, this.mode); | 497 this.logToServer.logStatistics(stats, this.mode); |
499 }; | 498 }; |
OLD | NEW |