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

Unified Diff: content/browser/devtools/protocol/emulation_handler.cc

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: content/browser/devtools/protocol/emulation_handler.cc
diff --git a/content/browser/devtools/protocol/emulation_handler.cc b/content/browser/devtools/protocol/emulation_handler.cc
index 764dc5edbbee6fbc846b271b0060645062f932b3..94037e2ee82ba3b9a850ccd6edbb53dd16da11c6 100644
--- a/content/browser/devtools/protocol/emulation_handler.cc
+++ b/content/browser/devtools/protocol/emulation_handler.cc
@@ -247,6 +247,10 @@ Response EmulationHandler::SetVisibleSize(int width, int height) {
if (!widget_host)
return Response::Error("Target does not support setVisibleSize");
+ if (width == 0)
+ width = widget_host->GetView()->GetViewBounds().width();
+ if (height == 0)
+ height = widget_host->GetView()->GetViewBounds().height();
widget_host->GetView()->SetSize(gfx::Size(width, height));
return Response::OK();
}

Powered by Google App Engine
This is Rietveld 408576698