Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
index 683101cec9c7be27f3dfb42418bf43128124e880..ff4094662b9126ceadc9492d83e44fd9c6b2948b 100644 |
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
@@ -56,6 +56,7 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/frame/PageScaleConstraintsSet.h" |
#include "core/frame/RemoteFrame.h" |
+#include "core/frame/ScrollAndScaleEmulator.h" |
#include "core/frame/Settings.h" |
#include "core/frame/SmartClip.h" |
#include "core/frame/TopControls.h" |
@@ -3249,6 +3250,23 @@ WebFloatSize WebViewImpl::visualViewportSize() const |
return page()->frameHost().visualViewport().visibleRect().size(); |
} |
+void WebViewImpl::setScrollAndScaleOverride(const IntPoint& framePosition, const DoublePoint& visualViewportPosition, float pageScale) |
+{ |
+ if (!page()) |
+ return; |
+ |
+ page()->frameHost().setScrollAndScaleOverride(framePosition, visualViewportPosition, pageScale); |
+} |
+ |
+void WebViewImpl::clearScrollAndScaleOverride() |
+{ |
+ if (!page()) |
+ return; |
+ |
+ page()->frameHost().clearScrollAndScaleOverride(); |
+ resetScrollAndScaleState(); |
+} |
+ |
void WebViewImpl::scrollAndRescaleViewports(float scaleFactor, |
const IntPoint& mainFrameOrigin, |
const FloatPoint& visualViewportOrigin) |
@@ -3384,7 +3402,13 @@ void WebViewImpl::setIgnoreViewportTagScaleLimits(bool ignore) |
IntSize WebViewImpl::mainFrameSize() |
{ |
// The frame size should match the viewport size at minimum scale, since the |
- // viewport must always be contained by the frame. |
+ // viewport must always be contained by the frame. As ScrollAndScaleEmulator |
+ // may override the minimum scale, it is responsible for this calculation if |
+ // it is active. |
+ if (page() && page()->frameHost().scrollAndScaleEmulator()) { |
+ return page()->frameHost().scrollAndScaleEmulator()->mainFrameSize(m_size); |
+ } |
+ |
FloatSize frameSize(m_size); |
frameSize.scale(1 / minimumPageScaleFactor()); |
return expandedIntSize(frameSize); |