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

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

Issue 1924043002: Switch the inheritance of WebViewClient from WebWidgetClient to protected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 c3acd08f5f04e4e600fdc4107904a0f8568faeb9..03f19518d0827daf5c716d0caf13ac11b59c1281 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -565,20 +565,28 @@ IntRect ChromeClientImpl::viewportToScreen(const IntRect& rectInViewport, const
DCHECK(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 (WebLocalFrameImpl::fromFrame(frame) && WebLocalFrameImpl::fromFrame(frame)->frameWidget() && WebLocalFrameImpl::fromFrame(frame)->frameWidget()->forSubframe()) {
dcheng 2016/04/27 23:55:04 I previously tried to remove this and failed, beca
lfg 2016/04/28 17:04:33 I removed the branch but had to add a virtual to W
+ WebWidgetClient* client = toWebFrameWidgetImpl(WebLocalFrameImpl::fromFrame(frame)->frameWidget())->client();
+
+ if (client) {
+ client->convertViewportToWindow(&screenRect);
+ WebRect windowRect = client->windowRect();
+ screenRect.x += windowRect.x;
+ screenRect.y += windowRect.y;
+ }
+ } else {
+ WebViewClient* client = m_webView->client();
- if (client) {
- client->convertViewportToWindow(&screenRect);
- WebRect windowRect = client->windowRect();
- screenRect.x += windowRect.x;
- screenRect.y += windowRect.y;
+ if (client) {
+ client->convertViewportToWindow(&screenRect);
+ WebRect windowRect = client->windowRect();
+ screenRect.x += windowRect.x;
+ screenRect.y += windowRect.y;
+ }
}
+
return screenRect;
}

Powered by Google App Engine
This is Rietveld 408576698