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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 44f2446632fc84ee790b38e7d3a2133f1022b82c..b3945d6e4b50aed6850ba77ebfcc7475d0485c90 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -158,6 +158,7 @@ FrameView::FrameView(LocalFrame* frame)
, m_verticalScrollbarMode(ScrollbarAuto)
, m_horizontalScrollbarLock(false)
, m_verticalScrollbarLock(false)
+ , m_visibleContentRectForRecording(nullptr)
, m_scrollbarsAvoidingResizer(0)
, m_scrollbarsSuppressed(false)
, m_inUpdateScrollbars(false)
@@ -3309,6 +3310,28 @@ IntSize FrameView::contentsSize() const
return m_contentsSize;
}
+IntSize FrameView::visibleContentSizeForRecording() const
+{
+ return visibleContentRectForRecording().size();
+}
+
+IntRect FrameView::visibleContentRectForRecording() const
+{
+ if (m_visibleContentRectForRecording)
+ return *m_visibleContentRectForRecording;
+ return visibleContentRect();
+}
+
+void FrameView::setVisibleContentRectForRecording(const IntRect& rect)
+{
+ m_visibleContentRectForRecording.reset(new IntRect(rect));
+}
+
+void FrameView::resetVisibleContentRectForRecording()
+{
+ m_visibleContentRectForRecording.reset();
+}
+
IntPoint FrameView::minimumScrollPosition() const
{
return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
@@ -3386,6 +3409,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache())
cache->handleScrollPositionChanged(this);
+ frame().host()->chromeClient().mainFrameScrollOffsetChanged();
Sami 2016/08/11 10:09:07 May need to guard this with m_frame->isMainFrame()
Eric Seckler 2016/08/11 11:34:45 You're right, guarding it now. I looked into the d
frame().loader().saveScrollState();
frame().loader().client()->didChangeScrollOffset();

Powered by Google App Engine
This is Rietveld 408576698