| 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 1e934d3b35189dd9d76e59e395aa91550e70f2e3..990500da903d1ef3c7ee7c0614440d7d8d11e0d5 100644
|
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
|
| @@ -3050,7 +3050,13 @@ double WebViewImpl::zoomLevel()
|
| return m_zoomLevel;
|
| }
|
|
|
| -double WebViewImpl::setZoomLevel(double zoomLevel)
|
| +double WebViewImpl::setZoomLevelForFrame(WebLocalFrame* frame, double zoomLevel)
|
| +{
|
| + LocalFrame* localFrame = static_cast<WebLocalFrameImpl*>(frame)->frame();
|
| + return setZoomLevelForFrame(localFrame, zoomLevel);
|
| +}
|
| +
|
| +double WebViewImpl::setZoomLevelForFrame(LocalFrame* frame, double zoomLevel)
|
| {
|
| if (zoomLevel < m_minimumZoomLevel)
|
| m_zoomLevel = m_minimumZoomLevel;
|
| @@ -3059,12 +3065,6 @@ double WebViewImpl::setZoomLevel(double zoomLevel)
|
| else
|
| m_zoomLevel = zoomLevel;
|
|
|
| - // TODO(nasko): Setting zoom level needs to be refactored to support
|
| - // out-of-process iframes. See https://crbug.com/528407.
|
| - if (mainFrame()->isWebRemoteFrame())
|
| - return m_zoomLevel;
|
| -
|
| - LocalFrame* frame = mainFrameImpl()->frame();
|
| if (!WebLocalFrameImpl::pluginContainerFromFrame(frame)) {
|
| float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_cast<float>(zoomLevelToZoomFactor(m_zoomLevel));
|
| if (m_zoomFactorForDeviceScaleFactor) {
|
| @@ -3083,6 +3083,22 @@ double WebViewImpl::setZoomLevel(double zoomLevel)
|
| return m_zoomLevel;
|
| }
|
|
|
| +double WebViewImpl::setZoomLevel(double zoomLevel)
|
| +{
|
| + // Code that wishes to set zoom level on local frames when the main frame is
|
| + // remote should call setZoomLevelForFrame() instead.
|
| + ASSERT(mainFrame()->isWebLocalFrame());
|
| +
|
| + if (zoomLevel < m_minimumZoomLevel)
|
| + m_zoomLevel = m_minimumZoomLevel;
|
| + else if (zoomLevel > m_maximumZoomLevel)
|
| + m_zoomLevel = m_maximumZoomLevel;
|
| + else
|
| + m_zoomLevel = zoomLevel;
|
| +
|
| + return setZoomLevelForFrame(mainFrameImpl()->frame(), m_zoomLevel);
|
| +}
|
| +
|
| void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel,
|
| double maximumZoomLevel)
|
| {
|
|
|