Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(839)

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js

Issue 2612913002: DevTools: Add feature to capture full-height screenshots (Closed)
Patch Set: DevTools: Add feature to capture full-height screenshots Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
}

Powered by Google App Engine
This is Rietveld 408576698