| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @constructor | 6 * @constructor |
| 7 * @param {function()} updateCallback | 7 * @param {function()} updateCallback |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.DeviceModeModel = function(updateCallback) | 10 WebInspector.DeviceModeModel = function(updateCallback) |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 * @return {number} | 330 * @return {number} |
| 331 */ | 331 */ |
| 332 _calculateScale: function(screenWidth, screenHeight) | 332 _calculateScale: function(screenWidth, screenHeight) |
| 333 { | 333 { |
| 334 var scale = this._fitSetting.get(); | 334 var scale = this._fitSetting.get(); |
| 335 if (!scale) { | 335 if (!scale) { |
| 336 if (!screenHeight && this._fixedFitScale) { | 336 if (!screenHeight && this._fixedFitScale) { |
| 337 scale = this._fitScale; | 337 scale = this._fitScale; |
| 338 } else { | 338 } else { |
| 339 scale = 1; | 339 scale = 1; |
| 340 while (this._availableSize.width < screenWidth * scale || (!scre
enHeight && this._availableSize.height < screenHeight * scale)) | 340 while (this._availableSize.width < screenWidth * scale || (scree
nHeight && this._availableSize.height < screenHeight * scale)) |
| 341 scale *= 0.8; | 341 scale *= 0.8; |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 return scale; | 344 return scale; |
| 345 }, | 345 }, |
| 346 | 346 |
| 347 /** | 347 /** |
| 348 * @param {string} userAgent | 348 * @param {string} userAgent |
| 349 */ | 349 */ |
| 350 _applyUserAgent: function(userAgent) | 350 _applyUserAgent: function(userAgent) |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 if (!this._target || orientation === this._screenOrientation) | 471 if (!this._target || orientation === this._screenOrientation) |
| 472 return; | 472 return; |
| 473 | 473 |
| 474 this._screenOrientation = orientation; | 474 this._screenOrientation = orientation; |
| 475 if (!this._screenOrientation) | 475 if (!this._screenOrientation) |
| 476 this._target.screenOrientationAgent().clearScreenOrientationOverride
(); | 476 this._target.screenOrientationAgent().clearScreenOrientationOverride
(); |
| 477 else | 477 else |
| 478 this._target.screenOrientationAgent().setScreenOrientationOverride(t
his._screenOrientation === "landscapePrimary" ? 90 : 0, /** @type {!ScreenOrient
ationAgent.OrientationType} */ (this._screenOrientation)); | 478 this._target.screenOrientationAgent().setScreenOrientationOverride(t
his._screenOrientation === "landscapePrimary" ? 90 : 0, /** @type {!ScreenOrient
ationAgent.OrientationType} */ (this._screenOrientation)); |
| 479 } | 479 } |
| 480 } | 480 } |
| OLD | NEW |