| 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;
|
| }
|
|
|