| 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 11 matching lines...) Expand all Loading... |
| 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef FrameLoaderClientImpl_h | 32 #ifndef LocalFrameClientImpl_h |
| 33 #define FrameLoaderClientImpl_h | 33 #define LocalFrameClientImpl_h |
| 34 | 34 |
| 35 #include "core/loader/FrameLoaderClient.h" | 35 #include "core/frame/LocalFrameClient.h" |
| 36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
| 37 #include "platform/weborigin/KURL.h" | 37 #include "platform/weborigin/KURL.h" |
| 38 #include "public/platform/WebInsecureRequestPolicy.h" | 38 #include "public/platform/WebInsecureRequestPolicy.h" |
| 39 #include "wtf/RefPtr.h" | 39 #include "wtf/RefPtr.h" |
| 40 |
| 40 #include <memory> | 41 #include <memory> |
| 41 | 42 |
| 42 namespace blink { | 43 namespace blink { |
| 43 | 44 |
| 44 class WebDevToolsAgentImpl; | 45 class WebDevToolsAgentImpl; |
| 45 class WebLocalFrameImpl; | 46 class WebLocalFrameImpl; |
| 46 | 47 |
| 47 class FrameLoaderClientImpl final : public FrameLoaderClient { | 48 class LocalFrameClientImpl final : public LocalFrameClient { |
| 48 public: | 49 public: |
| 49 static FrameLoaderClientImpl* create(WebLocalFrameImpl*); | 50 static LocalFrameClientImpl* create(WebLocalFrameImpl*); |
| 50 | 51 |
| 51 ~FrameLoaderClientImpl() override; | 52 ~LocalFrameClientImpl() override; |
| 52 | 53 |
| 53 DECLARE_VIRTUAL_TRACE(); | 54 DECLARE_VIRTUAL_TRACE(); |
| 54 | 55 |
| 55 WebLocalFrameImpl* webFrame() const { return m_webFrame.get(); } | 56 WebLocalFrameImpl* webFrame() const { return m_webFrame.get(); } |
| 56 | 57 |
| 57 // FrameLoaderClient ---------------------------------------------- | 58 // LocalFrameClient ---------------------------------------------- |
| 58 | 59 |
| 59 void didCreateNewDocument() override; | 60 void didCreateNewDocument() override; |
| 60 // Notifies the WebView delegate that the JS window object has been cleared, | 61 // Notifies the WebView delegate that the JS window object has been cleared, |
| 61 // giving it a chance to bind native objects to the window before script | 62 // giving it a chance to bind native objects to the window before script |
| 62 // parsing begins. | 63 // parsing begins. |
| 63 void dispatchDidClearWindowObjectInMainWorld() override; | 64 void dispatchDidClearWindowObjectInMainWorld() override; |
| 64 void documentElementAvailable() override; | 65 void documentElementAvailable() override; |
| 65 void runScriptsAtDocumentElementAvailable() override; | 66 void runScriptsAtDocumentElementAvailable() override; |
| 66 void runScriptsAtDocumentReady(bool documentIsEmpty) override; | 67 void runScriptsAtDocumentReady(bool documentIsEmpty) override; |
| 67 | 68 |
| 68 void didCreateScriptContext(v8::Local<v8::Context>, | 69 void didCreateScriptContext(v8::Local<v8::Context>, int worldId) override; |
| 69 int worldId) override; | |
| 70 void willReleaseScriptContext(v8::Local<v8::Context>, int worldId) override; | 70 void willReleaseScriptContext(v8::Local<v8::Context>, int worldId) override; |
| 71 | 71 |
| 72 // Returns true if we should allow register V8 extensions to be added. | 72 // Returns true if we should allow register V8 extensions to be added. |
| 73 bool allowScriptExtensions() override; | 73 bool allowScriptExtensions() override; |
| 74 | 74 |
| 75 bool hasWebView() const override; | 75 bool hasWebView() const override; |
| 76 bool inShadowTree() const override; | 76 bool inShadowTree() const override; |
| 77 Frame* opener() const override; | 77 Frame* opener() const override; |
| 78 void setOpener(Frame*) override; | 78 void setOpener(Frame*) override; |
| 79 Frame* parent() const override; | 79 Frame* parent() const override; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 LinkResource* createServiceWorkerLinkResource(HTMLLinkElement*) override; | 218 LinkResource* createServiceWorkerLinkResource(HTMLLinkElement*) override; |
| 219 | 219 |
| 220 WebEffectiveConnectionType getEffectiveConnectionType() override; | 220 WebEffectiveConnectionType getEffectiveConnectionType() override; |
| 221 | 221 |
| 222 KURL overrideFlashEmbedWithHTML(const KURL&) override; | 222 KURL overrideFlashEmbedWithHTML(const KURL&) override; |
| 223 | 223 |
| 224 void setHasReceivedUserGesture() override; | 224 void setHasReceivedUserGesture() override; |
| 225 | 225 |
| 226 private: | 226 private: |
| 227 explicit FrameLoaderClientImpl(WebLocalFrameImpl*); | 227 explicit LocalFrameClientImpl(WebLocalFrameImpl*); |
| 228 | 228 |
| 229 bool isFrameLoaderClientImpl() const override { return true; } | 229 bool isLocalFrameClientImpl() const override { return true; } |
| 230 WebDevToolsAgentImpl* devToolsAgent(); | 230 WebDevToolsAgentImpl* devToolsAgent(); |
| 231 | 231 |
| 232 // The WebFrame that owns this object and manages its lifetime. Therefore, | 232 // The WebFrame that owns this object and manages its lifetime. Therefore, |
| 233 // the web frame object is guaranteed to exist. | 233 // the web frame object is guaranteed to exist. |
| 234 Member<WebLocalFrameImpl> m_webFrame; | 234 Member<WebLocalFrameImpl> m_webFrame; |
| 235 | 235 |
| 236 String m_userAgent; | 236 String m_userAgent; |
| 237 }; | 237 }; |
| 238 | 238 |
| 239 DEFINE_TYPE_CASTS(FrameLoaderClientImpl, | 239 DEFINE_TYPE_CASTS(LocalFrameClientImpl, |
| 240 FrameLoaderClient, | 240 LocalFrameClient, |
| 241 client, | 241 client, |
| 242 client->isFrameLoaderClientImpl(), | 242 client->isLocalFrameClientImpl(), |
| 243 client.isFrameLoaderClientImpl()); | 243 client.isLocalFrameClientImpl()); |
| 244 | 244 |
| 245 } // namespace blink | 245 } // namespace blink |
| 246 | 246 |
| 247 #endif | 247 #endif |
| OLD | NEW |