Chromium Code Reviews| Index: Source/web/WebViewImpl.cpp |
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
| index f386bf5e02d5a79d2bfe6bb60eaef6a213dcf79d..b4f9b5ee13ce9f178d2ab434aef871a38e6c6a4d 100644 |
| --- a/Source/web/WebViewImpl.cpp |
| +++ b/Source/web/WebViewImpl.cpp |
| @@ -1669,6 +1669,7 @@ void WebViewImpl::resize(const WebSize& newSize) |
| WebFrameImpl* webFrame = mainFrameImpl(); |
| if (webFrame->frameView()) { |
| webFrame->frameView()->resize(m_size); |
| + |
|
aelias_OOO_until_Jul13
2013/09/06 23:11:18
nit: unnecessary newline diff
mkosiba (inactive)
2013/09/10 09:11:31
Done.
|
| if (m_pinchViewports) |
| m_pinchViewports->setViewportSize(m_size); |
| } |
| @@ -1685,7 +1686,7 @@ void WebViewImpl::resize(const WebSize& newSize) |
| float scaleMultiplier = viewportWidthRatio / contentsWidthRatio; |
| IntSize viewportSize = view->visibleContentRect().size(); |
| - if (scaleMultiplier != 1) { |
| + if (scaleMultiplier != 1 && !fixedLayoutSizeLock()) { |
|
aelias_OOO_until_Jul13
2013/09/06 23:11:18
I don't think you want the else clause of this cod
mkosiba (inactive)
2013/09/10 09:11:31
Done.
|
| float newPageScaleFactor = oldPageScaleFactor * scaleMultiplier; |
| viewportSize.scale(pageScaleFactor() / newPageScaleFactor); |
| IntPoint scrollOffsetAtNewScale = viewportAnchor.computeOrigin(viewportSize); |
| @@ -2965,7 +2966,7 @@ void WebViewImpl::refreshPageScaleFactorAfterLayout() |
| updatePageDefinedPageScaleConstraints(mainFrameImpl()->frame()->document()->viewportArguments()); |
| m_pageScaleConstraintsSet.computeFinalConstraints(); |
| - if (settings()->viewportEnabled()) { |
| + if (settings()->viewportEnabled() && !fixedLayoutSizeLock()) { |
| int verticalScrollbarWidth = 0; |
| if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlayScrollbar()) |
| verticalScrollbarWidth = view->verticalScrollbar()->width(); |
| @@ -3090,6 +3091,9 @@ WebSize WebViewImpl::fixedLayoutSize() const |
| void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) |
| { |
| + if (fixedLayoutSizeLock()) |
| + return; |
| + |
| if (!page()) |
| return; |
| @@ -3100,6 +3104,22 @@ void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) |
| frame->view()->setFixedLayoutSize(layoutSize); |
| } |
| +void WebViewImpl::setFixedLayoutSizeLock(bool enable) |
| +{ |
| + Frame* frame = page()->mainFrame(); |
| + if (!frame || !frame->view()) |
| + return; |
| + frame->view()->setFixedLayoutSizeLock(enable); |
| +} |
| + |
| +bool WebViewImpl::fixedLayoutSizeLock() const |
| +{ |
| + Frame* frame = page()->mainFrame(); |
| + if (!frame || !frame->view()) |
| + return false; |
| + return frame->view()->fixedLayoutSizeLock(); |
| +} |
| + |
| void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action, |
| const WebPoint& location) |
| { |