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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Emulator using GC, moved to FrameHost, addressed other comments. Created 4 years, 5 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/FrameHost.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameHost.cpp b/third_party/WebKit/Source/core/frame/FrameHost.cpp
index aa29cf0c5b4c71a6bcff71ed060278def6f6a8b7..aaf35306891ad6c0d335ae6669801a2f611adb3b 100644
--- a/third_party/WebKit/Source/core/frame/FrameHost.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameHost.cpp
@@ -35,6 +35,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/PageScaleConstraints.h"
#include "core/frame/PageScaleConstraintsSet.h"
+#include "core/frame/ScrollAndScaleEmulator.h"
#include "core/frame/TopControls.h"
#include "core/frame/VisualViewport.h"
#include "core/page/Page.h"
@@ -191,6 +192,7 @@ DEFINE_TRACE(FrameHost)
visitor->trace(m_overscrollController);
visitor->trace(m_eventHandlerRegistry);
visitor->trace(m_customElementReactionStack);
+ visitor->trace(m_scrollAndScaleEmulator);
}
#if ENABLE(ASSERT)
@@ -256,4 +258,26 @@ void FrameHost::setUserAgentPageScaleConstraints(const PageScaleConstraints& new
rootView->setNeedsLayout();
}
+void FrameHost::setScrollAndScaleOverride(const IntPoint& framePosition, const DoublePoint& visualViewportPosition, float pageScale)
+{
+ if (!page().mainFrame() || !page().mainFrame()->isLocalFrame())
+ return;
+
+ if (!m_scrollAndScaleEmulator) {
bokan 2016/07/06 14:26:31 Nit: no braces
Eric Seckler 2016/07/11 10:38:44 Done.
+ m_scrollAndScaleEmulator = ScrollAndScaleEmulator::create(this);
+ }
+
+ m_scrollAndScaleEmulator->update(
+ framePosition, visualViewportPosition, pageScale);
+}
+
+void FrameHost::clearScrollAndScaleOverride()
+{
+ if (!m_scrollAndScaleEmulator)
+ return;
+
+ m_scrollAndScaleEmulator->clear();
+ m_scrollAndScaleEmulator = nullptr;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698