Chromium Code Reviews| Index: third_party/WebKit/Source/core/inspector/DevToolsHost.cpp |
| diff --git a/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp b/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp |
| index 9854ebcd4eceab5bc6d0963d9c4cf95c16c25015..6593eafab937d5552f7e7063a89b32029db99fba 100644 |
| --- a/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/DevToolsHost.cpp |
| @@ -164,16 +164,12 @@ void DevToolsHost::disconnectClient() |
| float DevToolsHost::zoomFactor() |
| { |
| - return m_frontendFrame ? m_frontendFrame->pageZoomFactor() : 1; |
|
tkent
2016/03/03 13:05:55
The original code implies m_fontendFrame can be nu
oshima
2016/03/03 14:20:55
Good point. Done.
|
| -} |
| - |
| -float DevToolsHost::convertLengthForEmbedder(float length) |
| -{ |
| - if (!m_frontendFrame) |
| - return length; |
| + float zoomFactor = m_frontendFrame->pageZoomFactor(); |
| + // Cancel the device scale factor applied to the zoom factor in |
| + // use-zoom-for-dsf mode. |
| const HostWindow* hostWindow = m_frontendFrame->view()->hostWindow(); |
| - IntRect screen = hostWindow->viewportToScreen(IntRect(0, 0, length, 0)); |
| - return screen.width(); |
| + float windowToViewportRatio = hostWindow->windowToViewportScalar(1.0f); |
| + return zoomFactor / windowToViewportRatio; |
| } |
| void DevToolsHost::setInjectedScriptForOrigin(const String& origin, const String& script) |