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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.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
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 8f3b0599ccc04f8fbacac2070d9b68372254b95f..061f5ca982dd61013556f590cdf1f6e51c72a074 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
@@ -636,6 +636,9 @@ Emulation.DeviceModeModel = class {
if (!metrics)
return null;
+ if (!this._emulatedPageSize)
+ this._calculateAndEmulate(false);
+
var pageSize = fullSize ? new UI.Size(metrics.contentWidth, metrics.contentHeight) : this._emulatedPageSize;
var promises = [];
promises.push(
@@ -657,11 +660,11 @@ Emulation.DeviceModeModel = class {
await Promise.all(promises);
var screenshot = await screenCaptureModel.captureScreenshot('png', 100);
+ this._calculateAndEmulate(false);
dgozman 2017/04/21 20:40:54 You can move this back now.
pfeldman 2017/04/21 20:51:35 Done.
this._target.emulationAgent().setVisibleSize(
Math.floor(this._emulatedPageSize.width * this._scale),
Math.floor(this._emulatedPageSize.height * this._scale));
this._target.emulationAgent().resetViewport();
- this._calculateAndEmulate(false);
return screenshot;
}

Powered by Google App Engine
This is Rietveld 408576698