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

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

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 years, 3 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
Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index ddb64a39b87ba664bb7fbf7f9063af5db0fb94ec..d9527d2202235feddc96c7bde711836d3f3923fc 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -592,12 +592,14 @@ IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const
return screenRect;
}
-float ChromeClientImpl::windowToViewportScalar(const float scalarValue) const
+float ChromeClientImpl::windowToViewportScalar(const Widget& widget, const float scalarValue) const
{
- if (!m_webView->client())
- return scalarValue;
+ DCHECK(widget.isFrameView());
+ const FrameView* view = toFrameView(&widget);
+ LocalFrame* frame = view->frame().localFrameRoot();
+
WebFloatRect viewportRect(0, 0, scalarValue, 0);
- m_webView->client()->convertWindowToViewport(&viewportRect);
+ WebLocalFrameImpl::fromFrame(frame)->frameWidget()->client()->convertWindowToViewport(&viewportRect);
return viewportRect.width;
}
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/DateTimeChooserImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698