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

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: Disabled test on Mac 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 ee4687e1f71b73a5efc3c2b904af7ac300937da7..474db0e01e95bd8ce3bad9e845b71c0f13d0a2a0 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -545,13 +545,24 @@ void ChromeClientImpl::scheduleAnimation(Widget* widget)
}
}
-IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport) const
+IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const Widget* widget) const
{
WebRect screenRect(rectInViewport);
- if (m_webView->client()) {
- m_webView->client()->convertViewportToWindow(&screenRect);
- WebRect windowRect = m_webView->client()->windowRect();
+ ASSERT(widget->isFrameView());
+ const FrameView* view = toFrameView(widget);
+ LocalFrame* frame = view->frame().localFrameRoot();
+ WebWidgetClient* client = nullptr;
+
+ // TODO(kenrb): Consolidate this to a single case when WebViewFrameWidget refactor is complete.
+ if (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(frame)->frameWidget() && WebLocalFrameImpl::fromFrame(frame)->frameWidget()->forSubframe())
+ client = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFrame(frame)->frameWidget())->client();
+ else
+ client = m_webView->client();
+
+ if (client) {
+ client->convertViewportToWindow(&screenRect);
+ WebRect windowRect = client->windowRect();
screenRect.x += windowRect.x;
screenRect.y += windowRect.y;
}
« no previous file with comments | « third_party/WebKit/Source/web/ChromeClientImpl.h ('k') | third_party/WebKit/Source/web/ColorChooserPopupUIController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698