OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 void* ChromeClientImpl::webView() const | 178 void* ChromeClientImpl::webView() const |
179 { | 179 { |
180 return static_cast<void*>(m_webView); | 180 return static_cast<void*>(m_webView); |
181 } | 181 } |
182 | 182 |
183 void ChromeClientImpl::chromeDestroyed() | 183 void ChromeClientImpl::chromeDestroyed() |
184 { | 184 { |
185 // Our lifetime is bound to the WebViewImpl. | 185 // Our lifetime is bound to the WebViewImpl. |
186 } | 186 } |
187 | 187 |
188 void ChromeClientImpl::setWindowRect(const IntRect& r) | 188 void ChromeClientImpl::setWindowRect(const IntRect& r, LocalFrame& frame) |
189 { | 189 { |
190 if (m_webView->client()) | 190 DCHECK_EQ(&frame, m_webView->mainFrameImpl()->frame()); |
191 m_webView->client()->setWindowRect(r); | 191 WebWidgetClient* client = WebLocalFrameImpl::fromFrame(&frame)->frameWidget(
)->client(); |
| 192 client->setWindowRect(r); |
192 } | 193 } |
193 | 194 |
194 IntRect ChromeClientImpl::windowRect() | 195 IntRect ChromeClientImpl::rootWindowRect() |
195 { | 196 { |
196 WebRect rect; | 197 WebRect rect; |
197 if (m_webView->client()) { | 198 if (m_webView->client()) { |
198 rect = m_webView->client()->rootWindowRect(); | 199 rect = m_webView->client()->rootWindowRect(); |
199 } else { | 200 } else { |
200 // These numbers will be fairly wrong. The window's x/y coordinates will | 201 // These numbers will be fairly wrong. The window's x/y coordinates will |
201 // be the top left corner of the screen and the size will be the content | 202 // be the top left corner of the screen and the size will be the content |
202 // size instead of the window size. | 203 // size instead of the window size. |
203 rect.width = m_webView->size().width; | 204 rect.width = m_webView->size().width; |
204 rect.height = m_webView->size().height; | 205 rect.height = m_webView->size().height; |
205 } | 206 } |
206 return IntRect(rect); | 207 return IntRect(rect); |
207 } | 208 } |
208 | 209 |
209 IntRect ChromeClientImpl::pageRect() | 210 IntRect ChromeClientImpl::pageRect() |
210 { | 211 { |
211 // We hide the details of the window's border thickness from the web page by | 212 // We hide the details of the window's border thickness from the web page by |
212 // simple re-using the window position here. So, from the point-of-view of | 213 // simple re-using the window position here. So, from the point-of-view of |
213 // the web page, the window has no border. | 214 // the web page, the window has no border. |
214 return windowRect(); | 215 return rootWindowRect(); |
215 } | 216 } |
216 | 217 |
217 void ChromeClientImpl::focus() | 218 void ChromeClientImpl::focus() |
218 { | 219 { |
219 if (m_webView->client()) | 220 if (m_webView->client()) |
220 m_webView->client()->didFocus(); | 221 m_webView->client()->didFocus(); |
221 } | 222 } |
222 | 223 |
223 bool ChromeClientImpl::canTakeFocus(WebFocusType) | 224 bool ChromeClientImpl::canTakeFocus(WebFocusType) |
224 { | 225 { |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 { | 1094 { |
1094 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext)
.release()); | 1095 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext)
.release()); |
1095 } | 1096 } |
1096 | 1097 |
1097 double ChromeClientImpl::lastFrameTimeMonotonic() const | 1098 double ChromeClientImpl::lastFrameTimeMonotonic() const |
1098 { | 1099 { |
1099 return m_webView->lastFrameTimeMonotonic(); | 1100 return m_webView->lastFrameTimeMonotonic(); |
1100 } | 1101 } |
1101 | 1102 |
1102 } // namespace blink | 1103 } // namespace blink |
OLD | NEW |