| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return frame ? frame->toImplBase()->frame() : nullptr; | 122 return frame ? frame->toImplBase()->frame() : nullptr; |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace | 125 } // namespace |
| 126 | 126 |
| 127 FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) | 127 FrameLoaderClientImpl::FrameLoaderClientImpl(WebLocalFrameImpl* frame) |
| 128 : m_webFrame(frame) | 128 : m_webFrame(frame) |
| 129 { | 129 { |
| 130 } | 130 } |
| 131 | 131 |
| 132 PassOwnPtrWillBeRawPtr<FrameLoaderClientImpl> FrameLoaderClientImpl::create(WebL
ocalFrameImpl* frame) | 132 RawPtr<FrameLoaderClientImpl> FrameLoaderClientImpl::create(WebLocalFrameImpl* f
rame) |
| 133 { | 133 { |
| 134 return adoptPtrWillBeNoop(new FrameLoaderClientImpl(frame)); | 134 return new FrameLoaderClientImpl(frame); |
| 135 } | 135 } |
| 136 | 136 |
| 137 FrameLoaderClientImpl::~FrameLoaderClientImpl() | 137 FrameLoaderClientImpl::~FrameLoaderClientImpl() |
| 138 { | 138 { |
| 139 } | 139 } |
| 140 | 140 |
| 141 DEFINE_TRACE(FrameLoaderClientImpl) | 141 DEFINE_TRACE(FrameLoaderClientImpl) |
| 142 { | 142 { |
| 143 visitor->trace(m_webFrame); | 143 visitor->trace(m_webFrame); |
| 144 FrameLoaderClient::trace(visitor); | 144 FrameLoaderClient::trace(visitor); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 void FrameLoaderClientImpl::willBeDetached() | 376 void FrameLoaderClientImpl::willBeDetached() |
| 377 { | 377 { |
| 378 m_webFrame->willBeDetached(); | 378 m_webFrame->willBeDetached(); |
| 379 } | 379 } |
| 380 | 380 |
| 381 void FrameLoaderClientImpl::detached(FrameDetachType type) | 381 void FrameLoaderClientImpl::detached(FrameDetachType type) |
| 382 { | 382 { |
| 383 // Alert the client that the frame is being detached. This is the last | 383 // Alert the client that the frame is being detached. This is the last |
| 384 // chance we have to communicate with the client. | 384 // chance we have to communicate with the client. |
| 385 RefPtrWillBeRawPtr<WebLocalFrameImpl> protector(m_webFrame.get()); | 385 RawPtr<WebLocalFrameImpl> protector(m_webFrame.get()); |
| 386 | 386 |
| 387 WebFrameClient* client = m_webFrame->client(); | 387 WebFrameClient* client = m_webFrame->client(); |
| 388 if (!client) | 388 if (!client) |
| 389 return; | 389 return; |
| 390 | 390 |
| 391 m_webFrame->willDetachParent(); | 391 m_webFrame->willDetachParent(); |
| 392 | 392 |
| 393 // Signal that no further communication with WebFrameClient should take | 393 // Signal that no further communication with WebFrameClient should take |
| 394 // place at this point since we are no longer associated with the Page. | 394 // place at this point since we are no longer associated with the Page. |
| 395 m_webFrame->setClient(0); | 395 m_webFrame->setClient(0); |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 if (m_webFrame->client()) | 727 if (m_webFrame->client()) |
| 728 m_webFrame->client()->didChangePerformanceTiming(); | 728 m_webFrame->client()->didChangePerformanceTiming(); |
| 729 } | 729 } |
| 730 | 730 |
| 731 void FrameLoaderClientImpl::selectorMatchChanged(const Vector<String>& addedSele
ctors, const Vector<String>& removedSelectors) | 731 void FrameLoaderClientImpl::selectorMatchChanged(const Vector<String>& addedSele
ctors, const Vector<String>& removedSelectors) |
| 732 { | 732 { |
| 733 if (WebFrameClient* client = m_webFrame->client()) | 733 if (WebFrameClient* client = m_webFrame->client()) |
| 734 client->didMatchCSS(m_webFrame, WebVector<WebString>(addedSelectors), We
bVector<WebString>(removedSelectors)); | 734 client->didMatchCSS(m_webFrame, WebVector<WebString>(addedSelectors), We
bVector<WebString>(removedSelectors)); |
| 735 } | 735 } |
| 736 | 736 |
| 737 PassRefPtrWillBeRawPtr<DocumentLoader> FrameLoaderClientImpl::createDocumentLoad
er(LocalFrame* frame, const ResourceRequest& request, const SubstituteData& data
) | 737 RawPtr<DocumentLoader> FrameLoaderClientImpl::createDocumentLoader(LocalFrame* f
rame, const ResourceRequest& request, const SubstituteData& data) |
| 738 { | 738 { |
| 739 RefPtrWillBeRawPtr<WebDataSourceImpl> ds = WebDataSourceImpl::create(frame,
request, data); | 739 RawPtr<WebDataSourceImpl> ds = WebDataSourceImpl::create(frame, request, dat
a); |
| 740 if (m_webFrame->client()) | 740 if (m_webFrame->client()) |
| 741 m_webFrame->client()->didCreateDataSource(m_webFrame, ds.get()); | 741 m_webFrame->client()->didCreateDataSource(m_webFrame, ds.get()); |
| 742 return ds.release(); | 742 return ds.release(); |
| 743 } | 743 } |
| 744 | 744 |
| 745 String FrameLoaderClientImpl::userAgent() | 745 String FrameLoaderClientImpl::userAgent() |
| 746 { | 746 { |
| 747 WebString override = m_webFrame->client()->userAgentOverride(); | 747 WebString override = m_webFrame->client()->userAgentOverride(); |
| 748 if (!override.isEmpty()) | 748 if (!override.isEmpty()) |
| 749 return override; | 749 return override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 761 return String(); | 761 return String(); |
| 762 } | 762 } |
| 763 | 763 |
| 764 // Called when the FrameLoader goes into a state in which a new page load | 764 // Called when the FrameLoader goes into a state in which a new page load |
| 765 // will occur. | 765 // will occur. |
| 766 void FrameLoaderClientImpl::transitionToCommittedForNewPage() | 766 void FrameLoaderClientImpl::transitionToCommittedForNewPage() |
| 767 { | 767 { |
| 768 m_webFrame->createFrameView(); | 768 m_webFrame->createFrameView(); |
| 769 } | 769 } |
| 770 | 770 |
| 771 PassRefPtrWillBeRawPtr<LocalFrame> FrameLoaderClientImpl::createFrame( | 771 RawPtr<LocalFrame> FrameLoaderClientImpl::createFrame( |
| 772 const FrameLoadRequest& request, | 772 const FrameLoadRequest& request, |
| 773 const AtomicString& name, | 773 const AtomicString& name, |
| 774 HTMLFrameOwnerElement* ownerElement) | 774 HTMLFrameOwnerElement* ownerElement) |
| 775 { | 775 { |
| 776 return m_webFrame->createChildFrame(request, name, ownerElement); | 776 return m_webFrame->createChildFrame(request, name, ownerElement); |
| 777 } | 777 } |
| 778 | 778 |
| 779 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
e) const | 779 bool FrameLoaderClientImpl::canCreatePluginWithoutRenderer(const String& mimeTyp
e) const |
| 780 { | 780 { |
| 781 if (!m_webFrame->client()) | 781 if (!m_webFrame->client()) |
| 782 return false; | 782 return false; |
| 783 | 783 |
| 784 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); | 784 return m_webFrame->client()->canCreatePluginWithoutRenderer(mimeType); |
| 785 } | 785 } |
| 786 | 786 |
| 787 PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createPlugin( | 787 RawPtr<Widget> FrameLoaderClientImpl::createPlugin( |
| 788 HTMLPlugInElement* element, | 788 HTMLPlugInElement* element, |
| 789 const KURL& url, | 789 const KURL& url, |
| 790 const Vector<String>& paramNames, | 790 const Vector<String>& paramNames, |
| 791 const Vector<String>& paramValues, | 791 const Vector<String>& paramValues, |
| 792 const String& mimeType, | 792 const String& mimeType, |
| 793 bool loadManually, | 793 bool loadManually, |
| 794 DetachedPluginPolicy policy) | 794 DetachedPluginPolicy policy) |
| 795 { | 795 { |
| 796 if (!m_webFrame->client()) | 796 if (!m_webFrame->client()) |
| 797 return nullptr; | 797 return nullptr; |
| 798 | 798 |
| 799 WebPluginParams params; | 799 WebPluginParams params; |
| 800 params.url = url; | 800 params.url = url; |
| 801 params.mimeType = mimeType; | 801 params.mimeType = mimeType; |
| 802 params.attributeNames = paramNames; | 802 params.attributeNames = paramNames; |
| 803 params.attributeValues = paramValues; | 803 params.attributeValues = paramValues; |
| 804 params.loadManually = loadManually; | 804 params.loadManually = loadManually; |
| 805 | 805 |
| 806 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); | 806 WebPlugin* webPlugin = m_webFrame->client()->createPlugin(m_webFrame, params
); |
| 807 if (!webPlugin) | 807 if (!webPlugin) |
| 808 return nullptr; | 808 return nullptr; |
| 809 | 809 |
| 810 // The container takes ownership of the WebPlugin. | 810 // The container takes ownership of the WebPlugin. |
| 811 RefPtrWillBeRawPtr<WebPluginContainerImpl> container = | 811 RawPtr<WebPluginContainerImpl> container = |
| 812 WebPluginContainerImpl::create(element, webPlugin); | 812 WebPluginContainerImpl::create(element, webPlugin); |
| 813 | 813 |
| 814 if (!webPlugin->initialize(container.get())) | 814 if (!webPlugin->initialize(container.get())) |
| 815 return nullptr; | 815 return nullptr; |
| 816 | 816 |
| 817 if (policy != AllowDetachedPlugin && !element->layoutObject()) | 817 if (policy != AllowDetachedPlugin && !element->layoutObject()) |
| 818 return nullptr; | 818 return nullptr; |
| 819 | 819 |
| 820 return container; | 820 return container; |
| 821 } | 821 } |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde
nTerminationDisablerType type) | 1046 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde
nTerminationDisablerType type) |
| 1047 { | 1047 { |
| 1048 if (m_webFrame->client()) { | 1048 if (m_webFrame->client()) { |
| 1049 m_webFrame->client()->suddenTerminationDisablerChanged( | 1049 m_webFrame->client()->suddenTerminationDisablerChanged( |
| 1050 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>(
type)); | 1050 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>(
type)); |
| 1051 } | 1051 } |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 PassOwnPtrWillBeRawPtr<LinkResource> FrameLoaderClientImpl::createServiceWorkerL
inkResource(HTMLLinkElement* owner) | 1054 RawPtr<LinkResource> FrameLoaderClientImpl::createServiceWorkerLinkResource(HTML
LinkElement* owner) |
| 1055 { | 1055 { |
| 1056 return ServiceWorkerLinkResource::create(owner); | 1056 return ServiceWorkerLinkResource::create(owner); |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 } // namespace blink | 1059 } // namespace blink |
| OLD | NEW |