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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2612913002: DevTools: Add feature to capture full-height screenshots (Closed)
Patch Set: More readable 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/core/inspector/InspectorPageAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index f75a8df4027e28791a8e2ae110383ea6f2912055..61002f2d5695c140144cb16fc3902241fc09c96d 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -846,7 +846,8 @@ Response InspectorPageAgent::configureOverlay(Maybe<bool> suspended,
Response InspectorPageAgent::getLayoutMetrics(
std::unique_ptr<protocol::Page::LayoutViewport>* outLayoutViewport,
- std::unique_ptr<protocol::Page::VisualViewport>* outVisualViewport) {
+ std::unique_ptr<protocol::Page::VisualViewport>* outVisualViewport,
+ std::unique_ptr<protocol::DOM::Rect>* outContentSize) {
LocalFrame* mainFrame = m_inspectedFrames->root();
VisualViewport& visualViewport = mainFrame->host()->visualViewport();
@@ -868,6 +869,14 @@ Response InspectorPageAgent::getLayoutMetrics(
float scrollbarWidth = frameView->verticalScrollbarWidth() / scale;
float scrollbarHeight = frameView->horizontalScrollbarHeight() / scale;
+ IntSize contentSize = frameView->getScrollableArea()->contentsSize();
+ *outContentSize = protocol::DOM::Rect::create()
+ .setX(0)
+ .setY(0)
+ .setWidth(contentSize.width())
+ .setHeight(contentSize.height())
+ .build();
+
*outVisualViewport =
protocol::Page::VisualViewport::create()
.setOffsetX(adjustScrollForAbsoluteZoom(visibleRect.x(), pageZoom))

Powered by Google App Engine
This is Rietveld 408576698