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

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

Issue 1814863002: Make page popups work under OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebContentsImpl::SendScreenRects simplified Created 4 years, 9 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 b099c8b0037714bcd3463ba62248f777e0b2a660..1b699f7646552d34556bb4feccb27593bd33e887 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -507,11 +507,21 @@ void ChromeClientImpl::scheduleAnimation(Widget* widget)
}
}
-IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport) const
+IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const Widget* widget) const
bokan 2016/03/18 15:27:36 It seems like an awkward thing to have to pass in
kenrb 2016/03/18 17:46:10 The trouble is that there can be many local frame
bokan 2016/03/18 19:25:42 Ah, I see. ChromeClient still seems like an odd pl
{
WebRect screenRect(rectInViewport);
- if (m_webView->client()) {
+ ASSERT(widget->isFrameView());
bokan 2016/03/18 15:27:36 Just make the parameter a FrameView*?
kenrb 2016/03/18 17:46:10 I think it's a layering violation for HostWindow.h
bokan 2016/03/18 19:25:42 Ah, yah, you're right. Though that seems to imply
+ const FrameView* view = toFrameView(widget);
+ LocalFrame* frame = view->frame().localFrameRoot();
+
+ if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(frame)->frameWidget()) {
bokan 2016/03/18 15:27:36 Seems like the only difference in these branches i
kenrb 2016/03/18 17:46:10 Done.
+ WebFrameWidgetImpl* frameWidget = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFrame(frame)->frameWidget());
+ frameWidget->client()->convertViewportToWindow(&screenRect);
+ WebRect windowRect = frameWidget->client()->windowRect();
+ screenRect.x += windowRect.x;
+ screenRect.y += windowRect.y;
+ } else if (m_webView->client()) {
m_webView->client()->convertViewportToWindow(&screenRect);
WebRect windowRect = m_webView->client()->windowRect();
screenRect.x += windowRect.x;

Powered by Google App Engine
This is Rietveld 408576698