Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: third_party/WebKit/Source/web/InspectorOverlay.cpp

Issue 2108803006: Fix inspector overlay when use-zoom-for-dsf is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary include Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/InspectorOverlay.cpp
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp
index 795309b67d7bca53c075e5d11263dec0e9659ddf..8df6f1ef124630ba90fa426ce9d0c0e71188e426 100644
--- a/third_party/WebKit/Source/web/InspectorOverlay.cpp
+++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -389,8 +389,7 @@ void InspectorOverlay::rebuildOverlayPage()
LocalFrame* frame = toLocalFrame(overlayPage()->mainFrame());
frame->view()->resize(viewportSize);
overlayPage()->frameHost().visualViewport().setSize(viewportSize);
- float windowToViewportScale = m_webViewImpl->chromeClient().windowToViewportScalar(1.0f);
- frame->setPageZoomFactor(windowToViewportScale);
+ frame->setPageZoomFactor(windowToViewportScale());
reset(viewportSize, visibleRectInDocument.location());
@@ -426,14 +425,14 @@ void InspectorOverlay::drawNodeHighlight()
if (elements && !exceptionState.hadException()) {
for (unsigned i = 0; i < elements->length(); ++i) {
Element* element = elements->item(i);
- InspectorHighlight highlight(element, m_nodeHighlightConfig, false);
+ InspectorHighlight highlight(element, m_nodeHighlightConfig, false, windowToViewportScale());
oshima 2016/07/01 12:03:18 can you pass this value in resetData instead? That
Bret 2016/07/01 18:24:35 Ah yes, that's better. Done.
std::unique_ptr<protocol::DictionaryValue> highlightJSON = highlight.asProtocolValue();
evaluateInOverlay("drawHighlight", std::move(highlightJSON));
}
}
bool appendElementInfo = m_highlightNode->isElementNode() && !m_omitTooltip && m_nodeHighlightConfig.showInfo && m_highlightNode->layoutObject() && m_highlightNode->document().frame();
- InspectorHighlight highlight(m_highlightNode.get(), m_nodeHighlightConfig, appendElementInfo);
+ InspectorHighlight highlight(m_highlightNode.get(), m_nodeHighlightConfig, appendElementInfo, windowToViewportScale());
if (m_eventTargetNode)
highlight.appendEventTargetQuads(m_eventTargetNode.get(), m_nodeHighlightConfig);
@@ -463,6 +462,11 @@ void InspectorOverlay::drawViewSize()
evaluateInOverlay("drawViewSize", "");
}
+float InspectorOverlay::windowToViewportScale() const
+{
+ return m_webViewImpl->chromeClient().windowToViewportScalar(1.0f);
+}
+
Page* InspectorOverlay::overlayPage()
{
if (m_overlayPage)
@@ -544,8 +548,7 @@ void InspectorOverlay::reset(const IntSize& viewportSize, const IntPoint& docume
// The zoom factor in the overlay frame already has been multiplied by the window to viewport scale
// (aka device scale factor), so cancel it.
- float windowToViewportScale = m_webViewImpl->chromeClient().windowToViewportScalar(1.0f);
- resetData->setNumber("pageZoomFactor", m_webViewImpl->mainFrameImpl()->frame()->pageZoomFactor() / windowToViewportScale);
+ resetData->setNumber("pageZoomFactor", m_webViewImpl->mainFrameImpl()->frame()->pageZoomFactor() / windowToViewportScale());
resetData->setNumber("scrollX", documentScrollOffset.x());
resetData->setNumber("scrollY", documentScrollOffset.y());
« no previous file with comments | « third_party/WebKit/Source/web/InspectorOverlay.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698