| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool FrameLoaderClientImpl::hasWebView() const | 248 bool FrameLoaderClientImpl::hasWebView() const |
| 249 { | 249 { |
| 250 return m_webFrame->viewImpl(); | 250 return m_webFrame->viewImpl(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 Frame* FrameLoaderClientImpl::opener() const | 253 Frame* FrameLoaderClientImpl::opener() const |
| 254 { | 254 { |
| 255 return toWebCoreFrame(m_webFrame->opener()); | 255 return toCoreFrame(m_webFrame->opener()); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void FrameLoaderClientImpl::setOpener(Frame* opener) | 258 void FrameLoaderClientImpl::setOpener(Frame* opener) |
| 259 { | 259 { |
| 260 // FIXME: Temporary hack to stage converting locations that really should be
Frame. | 260 // FIXME: Temporary hack to stage converting locations that really should be
Frame. |
| 261 m_webFrame->setOpener(WebLocalFrameImpl::fromFrame(toLocalFrame(opener))); | 261 m_webFrame->setOpener(WebLocalFrameImpl::fromFrame(toLocalFrame(opener))); |
| 262 } | 262 } |
| 263 | 263 |
| 264 Frame* FrameLoaderClientImpl::parent() const | 264 Frame* FrameLoaderClientImpl::parent() const |
| 265 { | 265 { |
| 266 return toWebCoreFrame(m_webFrame->parent()); | 266 return toCoreFrame(m_webFrame->parent()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 Frame* FrameLoaderClientImpl::top() const | 269 Frame* FrameLoaderClientImpl::top() const |
| 270 { | 270 { |
| 271 return toWebCoreFrame(m_webFrame->top()); | 271 return toCoreFrame(m_webFrame->top()); |
| 272 } | 272 } |
| 273 | 273 |
| 274 Frame* FrameLoaderClientImpl::previousSibling() const | 274 Frame* FrameLoaderClientImpl::previousSibling() const |
| 275 { | 275 { |
| 276 return toWebCoreFrame(m_webFrame->previousSibling()); | 276 return toCoreFrame(m_webFrame->previousSibling()); |
| 277 } | 277 } |
| 278 | 278 |
| 279 Frame* FrameLoaderClientImpl::nextSibling() const | 279 Frame* FrameLoaderClientImpl::nextSibling() const |
| 280 { | 280 { |
| 281 return toWebCoreFrame(m_webFrame->nextSibling()); | 281 return toCoreFrame(m_webFrame->nextSibling()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 Frame* FrameLoaderClientImpl::firstChild() const | 284 Frame* FrameLoaderClientImpl::firstChild() const |
| 285 { | 285 { |
| 286 return toWebCoreFrame(m_webFrame->firstChild()); | 286 return toCoreFrame(m_webFrame->firstChild()); |
| 287 } | 287 } |
| 288 | 288 |
| 289 Frame* FrameLoaderClientImpl::lastChild() const | 289 Frame* FrameLoaderClientImpl::lastChild() const |
| 290 { | 290 { |
| 291 return toWebCoreFrame(m_webFrame->lastChild()); | 291 return toCoreFrame(m_webFrame->lastChild()); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void FrameLoaderClientImpl::detachedFromParent() | 294 void FrameLoaderClientImpl::detachedFromParent() |
| 295 { | 295 { |
| 296 // Alert the client that the frame is being detached. This is the last | 296 // Alert the client that the frame is being detached. This is the last |
| 297 // chance we have to communicate with the client. | 297 // chance we have to communicate with the client. |
| 298 RefPtr<WebLocalFrameImpl> protector(m_webFrame); | 298 RefPtr<WebLocalFrameImpl> protector(m_webFrame); |
| 299 | 299 |
| 300 WebFrameClient* client = m_webFrame->client(); | 300 WebFrameClient* client = m_webFrame->client(); |
| 301 if (!client) | 301 if (!client) |
| 302 return; | 302 return; |
| 303 | 303 |
| 304 m_webFrame->willDetachParent(); | 304 m_webFrame->willDetachParent(); |
| 305 | 305 |
| 306 // Signal that no further communication with WebFrameClient should take | 306 // Signal that no further communication with WebFrameClient should take |
| 307 // place at this point since we are no longer associated with the Page. | 307 // place at this point since we are no longer associated with the Page. |
| 308 m_webFrame->setClient(0); | 308 m_webFrame->setClient(0); |
| 309 | 309 |
| 310 client->frameDetached(m_webFrame); | 310 client->frameDetached(m_webFrame); |
| 311 // Clear our reference to LocalFrame at the very end, in case the client | 311 // Clear our reference to LocalFrame at the very end, in case the client |
| 312 // refers to it. | 312 // refers to it. |
| 313 m_webFrame->setWebCoreFrame(nullptr); | 313 m_webFrame->setCoreFrame(nullptr); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void FrameLoaderClientImpl::dispatchWillSendRequest( | 316 void FrameLoaderClientImpl::dispatchWillSendRequest( |
| 317 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, | 317 DocumentLoader* loader, unsigned long identifier, ResourceRequest& request, |
| 318 const ResourceResponse& redirectResponse) | 318 const ResourceResponse& redirectResponse) |
| 319 { | 319 { |
| 320 // Give the WebFrameClient a crack at the request. | 320 // Give the WebFrameClient a crack at the request. |
| 321 if (m_webFrame->client()) { | 321 if (m_webFrame->client()) { |
| 322 WrappedResourceRequest webreq(request); | 322 WrappedResourceRequest webreq(request); |
| 323 WrappedResourceResponse webresp(redirectResponse); | 323 WrappedResourceResponse webresp(redirectResponse); |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 m_webFrame->client()->didAbortLoading(m_webFrame); | 827 m_webFrame->client()->didAbortLoading(m_webFrame); |
| 828 } | 828 } |
| 829 | 829 |
| 830 void FrameLoaderClientImpl::dispatchDidChangeManifest() | 830 void FrameLoaderClientImpl::dispatchDidChangeManifest() |
| 831 { | 831 { |
| 832 if (m_webFrame->client()) | 832 if (m_webFrame->client()) |
| 833 m_webFrame->client()->didChangeManifest(m_webFrame); | 833 m_webFrame->client()->didChangeManifest(m_webFrame); |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace blink | 836 } // namespace blink |
| OLD | NEW |