Chromium Code Reviews| 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; |