| 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 11 matching lines...) Expand all Loading... |
| 22 // Zero means "fit", positive number is a scale itself. | 22 // Zero means "fit", positive number is a scale itself. |
| 23 this._fitSetting = WebInspector.settings.createSetting("emulation.deviceFit"
, 0); | 23 this._fitSetting = WebInspector.settings.createSetting("emulation.deviceFit"
, 0); |
| 24 this._fitSetting.addChangeListener(this._fitSettingChanged, this); | 24 this._fitSetting.addChangeListener(this._fitSettingChanged, this); |
| 25 this._widthSetting = WebInspector.settings.createSetting("emulation.deviceWi
dth", 400); | 25 this._widthSetting = WebInspector.settings.createSetting("emulation.deviceWi
dth", 400); |
| 26 this._widthSetting.addChangeListener(this._widthSettingChanged, this); | 26 this._widthSetting.addChangeListener(this._widthSettingChanged, this); |
| 27 this._deviceScaleFactorSetting = WebInspector.settings.createSetting("emulat
ion.deviceScaleFactor", 0); | 27 this._deviceScaleFactorSetting = WebInspector.settings.createSetting("emulat
ion.deviceScaleFactor", 0); |
| 28 this._deviceScaleFactorSetting.addChangeListener(this._deviceScaleFactorSett
ingChanged, this); | 28 this._deviceScaleFactorSetting.addChangeListener(this._deviceScaleFactorSett
ingChanged, this); |
| 29 | 29 |
| 30 /** @type {!WebInspector.DeviceModeModel.Type} */ | 30 /** @type {!WebInspector.DeviceModeModel.Type} */ |
| 31 this._type = WebInspector.DeviceModeModel.Type.Desktop; | 31 this._type = WebInspector.DeviceModeModel.Type.Desktop; |
| 32 this._fitSetting.set(0); | |
| 33 this._deviceScaleFactorSetting.set(0); | |
| 34 /** @type {?WebInspector.EmulatedDevice} */ | 32 /** @type {?WebInspector.EmulatedDevice} */ |
| 35 this._device = null; | 33 this._device = null; |
| 36 /** @type {?WebInspector.EmulatedDevice.Mode} */ | 34 /** @type {?WebInspector.EmulatedDevice.Mode} */ |
| 37 this._mode = null; | 35 this._mode = null; |
| 38 /** @type {boolean} */ | 36 /** @type {boolean} */ |
| 39 this._touchEnabled = false; | 37 this._touchEnabled = false; |
| 40 /** @type {string} */ | 38 /** @type {string} */ |
| 41 this._touchConfiguration = ""; | 39 this._touchConfiguration = ""; |
| 42 /** @type {string} */ | 40 /** @type {string} */ |
| 43 this._screenOrientation = ""; | 41 this._screenOrientation = ""; |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 if (!this._target || orientation === this._screenOrientation) | 491 if (!this._target || orientation === this._screenOrientation) |
| 494 return; | 492 return; |
| 495 | 493 |
| 496 this._screenOrientation = orientation; | 494 this._screenOrientation = orientation; |
| 497 if (!this._screenOrientation) | 495 if (!this._screenOrientation) |
| 498 this._target.screenOrientationAgent().clearScreenOrientationOverride
(); | 496 this._target.screenOrientationAgent().clearScreenOrientationOverride
(); |
| 499 else | 497 else |
| 500 this._target.screenOrientationAgent().setScreenOrientationOverride(t
his._screenOrientation === "landscapePrimary" ? 90 : 0, /** @type {!ScreenOrient
ationAgent.OrientationType} */ (this._screenOrientation)); | 498 this._target.screenOrientationAgent().setScreenOrientationOverride(t
his._screenOrientation === "landscapePrimary" ? 90 : 0, /** @type {!ScreenOrient
ationAgent.OrientationType} */ (this._screenOrientation)); |
| 501 } | 499 } |
| 502 } | 500 } |
| OLD | NEW |