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 da897ce2e41e776c0843f46d6083df3d2d0316f8..defc36d954112c2e9aef7b9a0ae32060546586ce 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); |
| + CHECK(frame == m_webView->mainFrameImpl()->frame()); |
|
bokan
2016/07/26 23:17:05
Wouldn't it be easier if ChromeClient implementati
dcheng
2016/07/29 08:31:11
Why CHECK()? In general, it's better to avoid CHEC
|
| + WebWidgetClient* client = WebLocalFrameImpl::fromFrame(frame)->frameWidget()->client(); |
| + |
| + if (client) |
| + 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() |