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

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

Issue 2177333002: Move setWindowRect and windowRect calls from WebViewClient to WebWidgetClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change CHECK to a DCHECK Created 4 years, 5 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 1c2e7784d2bde4cddf3a0c06d41c1d99231a2e2a..96ef4d97c61e5688d2a04231e9c31f1019a87b61 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -185,13 +185,16 @@ void ChromeClientImpl::chromeDestroyed()
// Our lifetime is bound to the WebViewImpl.
}
-void ChromeClientImpl::setWindowRect(const IntRect& r)
+void ChromeClientImpl::setWindowRect(const IntRect& r, LocalFrame* frame)
{
- if (m_webView->client())
- m_webView->client()->setWindowRect(r);
+ DCHECK(frame == m_webView->mainFrameImpl()->frame());
dcheng 2016/08/15 18:22:44 Nit: DCHECK_EQ
lfg 2016/08/16 21:02:13 Done.
+ WebWidgetClient* client = WebLocalFrameImpl::fromFrame(frame)->frameWidget()->client();
+
+ if (client)
dcheng 2016/08/15 18:22:44 Do we need to nullcheck this? It looks like the ca
lfg 2016/08/16 21:02:13 It's been a while, so I don't remember exactly, bu
+ client->setWindowRect(r);
}
-IntRect ChromeClientImpl::windowRect()
+IntRect ChromeClientImpl::rootWindowRect()
{
WebRect rect;
if (m_webView->client()) {
@@ -211,7 +214,7 @@ IntRect ChromeClientImpl::pageRect()
// We hide the details of the window's border thickness from the web page by
// simple re-using the window position here. So, from the point-of-view of
// the web page, the window has no border.
- return windowRect();
+ return rootWindowRect();
}
void ChromeClientImpl::focus()

Powered by Google App Engine
This is Rietveld 408576698