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

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

Issue 2837463002: DevTools: allow capturing screenshots from command menu. (Closed)
Patch Set: clean Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
index 54df762fd9b4306d512d0612a29476592a412acf..0144678d78d03fb867a1fab3ef4b2e87b8ae6556 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
@@ -25,22 +25,17 @@ Emulation.DeviceModeWrapper = class extends UI.VBox {
}
/**
+ * @param {boolean=} fullSize
* @return {boolean}
*/
- _captureScreenshot() {
+ _captureScreenshot(fullSize) {
if (!this._deviceModeView)
- return false;
- this._deviceModeView.captureScreenshot();
- return true;
- }
-
- /**
- * @return {boolean}
- */
- _captureFullSizeScreenshot() {
- if (!this._deviceModeView)
- return false;
- this._deviceModeView.captureFullSizeScreenshot();
+ this._deviceModeView = new Emulation.DeviceModeView();
+ this._deviceModeView.setNonEmulatedAvailableSize(this._inspectedPagePlaceholder.element);
+ if (fullSize)
+ this._deviceModeView.captureFullSizeScreenshot();
+ else
+ this._deviceModeView.captureScreenshot();
return true;
}
@@ -91,7 +86,7 @@ Emulation.DeviceModeWrapper.ActionDelegate = class {
return Emulation.DeviceModeView._wrapperInstance._captureScreenshot();
case 'emulation.capture-full-height-screenshot':
- return Emulation.DeviceModeView._wrapperInstance._captureFullSizeScreenshot();
+ return Emulation.DeviceModeView._wrapperInstance._captureScreenshot(true);
case 'emulation.toggle-device-mode':
Emulation.DeviceModeView._wrapperInstance._toggleDeviceMode();
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698