Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| index acea052bce094791db15928820f94b6d61d17ff1..e51e17a89bed94434707a8fb5f257c5ebd3780cb 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js |
| @@ -273,6 +273,15 @@ Emulation.DeviceModeModel = class { |
| } |
| /** |
| + * @return {boolean} |
| + */ |
| + isMobile() { |
| + if (this._device && this._device.mobile()) |
| + return true; |
| + return false; |
|
dgozman
2017/01/12 21:49:35
Note this is incorrect for responsive mode.
ahmetemirercin
2017/01/13 01:49:23
Done.
|
| + } |
| + |
| + /** |
| * @return {!Common.Setting} |
| */ |
| scaleSetting() { |
| @@ -522,7 +531,10 @@ Emulation.DeviceModeModel = class { |
| screenSize.height = Math.max(1, Math.floor(screenSize.height)); |
| var pageWidth = screenSize.width - insets.left - insets.right; |
| + this._emulatedPageWidth = pageWidth * scale; |
|
dgozman
2017/01/12 21:49:35
Use Size instead of width+height.
ahmetemirercin
2017/01/13 01:49:23
Done.
|
| + |
| var pageHeight = screenSize.height - insets.top - insets.bottom; |
| + this._emulatedPageHeight = pageHeight * scale; |
| var positionX = insets.left; |
| var positionY = insets.top; |
| @@ -596,6 +608,10 @@ Emulation.DeviceModeModel = class { |
| } |
| } |
| + resetVisibleSize() { |
| + this._target.emulationAgent().setVisibleSize(this._emulatedPageWidth, this._emulatedPageHeight); |
|
dgozman
2017/01/12 21:49:35
If we reset not by passing zeroes, let's not chang
ahmetemirercin
2017/01/13 01:49:23
Done.
|
| + } |
| + |
| _deviceMetricsOverrideAppliedForTest() { |
| // Used for sniffing in tests. |
| } |