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 2ff804ebb0cef02fe89bcd33c78e41db630d25b3..9b11a22ce559ba9d0024cb9121a3e1c33487dbc5 100644 |
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
@@ -412,6 +412,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) |
, m_zoomLevel(0) |
, m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)) |
, m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)) |
+ , m_zoomFactorForDeviceScaleFactor(1.f) |
, m_maximumLegibleScale(1) |
, m_doubleTapZoomPageScaleFactor(0) |
, m_doubleTapZoomPending(false) |
@@ -2958,6 +2959,7 @@ double WebViewImpl::setZoomLevel(double zoomLevel) |
LocalFrame* frame = mainFrameImpl()->frame(); |
if (!WebLocalFrameImpl::pluginContainerFromFrame(frame)) { |
float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_cast<float>(zoomLevelToZoomFactor(m_zoomLevel)); |
+ zoomFactor *= m_zoomFactorForDeviceScaleFactor; |
frame->setPageZoomFactor(zoomFactor); |
} |
@@ -3103,6 +3105,15 @@ void WebViewImpl::setDeviceScaleFactor(float scaleFactor) |
updateLayerTreeDeviceScaleFactor(); |
} |
+void WebViewImpl::setZoomFactorForDeviceScaleFactor(float zoomFactorForDeviceScaleFactor) |
+{ |
+ if (!m_layerTreeView || m_zoomFactorForDeviceScaleFactor == zoomFactorForDeviceScaleFactor) |
+ return; |
+ m_zoomFactorForDeviceScaleFactor = zoomFactorForDeviceScaleFactor; |
+ setZoomLevel(m_zoomLevel); |
+ updateLayerTreeDeviceScaleFactor(); |
+} |
+ |
void WebViewImpl::setDeviceColorProfile(const WebVector<char>& colorProfile) |
{ |
if (!page()) |