| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SKY_ENGINE_WEB_WEBLOCALFRAMEIMPL_H_ | 31 #ifndef SKY_ENGINE_WEB_WEBLOCALFRAMEIMPL_H_ |
| 32 #define SKY_ENGINE_WEB_WEBLOCALFRAMEIMPL_H_ | 32 #define SKY_ENGINE_WEB_WEBLOCALFRAMEIMPL_H_ |
| 33 | 33 |
| 34 #include "sky/engine/core/frame/LocalFrame.h" | 34 #include "sky/engine/core/frame/LocalFrame.h" |
| 35 #include "sky/engine/platform/fetcher/MojoFetcher.h" |
| 35 #include "sky/engine/platform/geometry/FloatRect.h" | 36 #include "sky/engine/platform/geometry/FloatRect.h" |
| 36 #include "sky/engine/public/web/WebLocalFrame.h" | 37 #include "sky/engine/public/web/WebLocalFrame.h" |
| 37 #include "sky/engine/web/FrameLoaderClientImpl.h" | 38 #include "sky/engine/web/FrameLoaderClientImpl.h" |
| 38 #include "sky/engine/wtf/Compiler.h" | 39 #include "sky/engine/wtf/Compiler.h" |
| 39 #include "sky/engine/wtf/OwnPtr.h" | 40 #include "sky/engine/wtf/OwnPtr.h" |
| 40 #include "sky/engine/wtf/RefCounted.h" | 41 #include "sky/engine/wtf/RefCounted.h" |
| 41 #include "sky/engine/wtf/text/WTFString.h" | 42 #include "sky/engine/wtf/text/WTFString.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 class GraphicsContext; | 46 class GraphicsContext; |
| 46 class IntSize; | 47 class IntSize; |
| 47 class KURL; | 48 class KURL; |
| 48 class Node; | 49 class Node; |
| 49 class Range; | 50 class Range; |
| 50 class WebFrameClient; | 51 class WebFrameClient; |
| 51 class WebView; | 52 class WebView; |
| 52 class WebViewImpl; | 53 class WebViewImpl; |
| 53 | 54 |
| 54 template <typename T> class WebVector; | 55 template <typename T> class WebVector; |
| 55 | 56 |
| 56 // Implementation of WebFrame, note that this is a reference counted object. | 57 // Implementation of WebFrame, note that this is a reference counted object. |
| 57 class WebLocalFrameImpl final | 58 class WebLocalFrameImpl final |
| 58 : public WebLocalFrame | 59 : public WebLocalFrame |
| 60 , public MojoFetcher::Client |
| 59 , public RefCounted<WebLocalFrameImpl> { | 61 , public RefCounted<WebLocalFrameImpl> { |
| 60 public: | 62 public: |
| 61 // WebFrame methods: | 63 // WebFrame methods: |
| 62 virtual bool isWebLocalFrame() const override; | 64 virtual bool isWebLocalFrame() const override; |
| 63 virtual WebLocalFrame* toWebLocalFrame() override; | 65 virtual WebLocalFrame* toWebLocalFrame() override; |
| 64 virtual void close() override; | 66 virtual void close() override; |
| 65 virtual WebSize contentsSize() const override; | 67 virtual WebSize contentsSize() const override; |
| 66 virtual bool hasVisibleContent() const override; | 68 virtual bool hasVisibleContent() const override; |
| 67 virtual WebRect visibleContentRect() const override; | 69 virtual WebRect visibleContentRect() const override; |
| 68 virtual WebView* view() const override; | 70 virtual WebView* view() const override; |
| 69 virtual WebDocument document() const override; | 71 virtual WebDocument document() const override; |
| 70 virtual void executeScript(const WebScriptSource&) override; | 72 virtual void executeScript(const WebScriptSource&) override; |
| 71 virtual void addMessageToConsole(const WebConsoleMessage&) override; | 73 virtual void addMessageToConsole(const WebConsoleMessage&) override; |
| 72 virtual void collectGarbage() override; | 74 virtual void collectGarbage() override; |
| 75 virtual void load(const WebURL&); |
| 73 virtual void load(const WebURL&, mojo::ScopedDataPipeConsumerHandle); | 76 virtual void load(const WebURL&, mojo::ScopedDataPipeConsumerHandle); |
| 74 virtual void replaceSelection(const WebString&) override; | 77 virtual void replaceSelection(const WebString&) override; |
| 75 virtual void insertText(const WebString&) override; | 78 virtual void insertText(const WebString&) override; |
| 76 virtual void setMarkedText(const WebString&, unsigned location, unsigned len
gth) override; | 79 virtual void setMarkedText(const WebString&, unsigned location, unsigned len
gth) override; |
| 77 virtual void unmarkText() override; | 80 virtual void unmarkText() override; |
| 78 virtual bool hasMarkedText() const override; | 81 virtual bool hasMarkedText() const override; |
| 79 virtual bool executeCommand(const WebString&, const WebNode& = WebNode()) ov
erride; | 82 virtual bool executeCommand(const WebString&, const WebNode& = WebNode()) ov
erride; |
| 80 virtual bool executeCommand(const WebString&, const WebString& value, const
WebNode& = WebNode()) override; | 83 virtual bool executeCommand(const WebString&, const WebString& value, const
WebNode& = WebNode()) override; |
| 81 virtual bool isCommandEnabled(const WebString&) const override; | 84 virtual bool isCommandEnabled(const WebString&) const override; |
| 82 virtual void enableContinuousSpellChecking(bool) override; | 85 virtual void enableContinuousSpellChecking(bool) override; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 VisiblePosition visiblePositionForWindowPoint(const WebPoint&); | 133 VisiblePosition visiblePositionForWindowPoint(const WebPoint&); |
| 131 | 134 |
| 132 private: | 135 private: |
| 133 friend class FrameLoaderClientImpl; | 136 friend class FrameLoaderClientImpl; |
| 134 | 137 |
| 135 explicit WebLocalFrameImpl(WebFrameClient*); | 138 explicit WebLocalFrameImpl(WebFrameClient*); |
| 136 | 139 |
| 137 // Sets the local core frame and registers destruction observers. | 140 // Sets the local core frame and registers destruction observers. |
| 138 void setCoreFrame(PassRefPtr<LocalFrame>); | 141 void setCoreFrame(PassRefPtr<LocalFrame>); |
| 139 | 142 |
| 143 // MojoFetcher::Client |
| 144 void OnReceivedResponse(mojo::URLResponsePtr) override; |
| 145 |
| 140 FrameLoaderClientImpl m_frameLoaderClientImpl; | 146 FrameLoaderClientImpl m_frameLoaderClientImpl; |
| 141 | 147 |
| 142 // The embedder retains a reference to the WebCore LocalFrame while it is ac
tive in the DOM. This | 148 // The embedder retains a reference to the WebCore LocalFrame while it is ac
tive in the DOM. This |
| 143 // reference is released when the frame is removed from the DOM or the entir
e page is closed. | 149 // reference is released when the frame is removed from the DOM or the entir
e page is closed. |
| 144 // FIXME: These will need to change to WebFrame when we introduce WebFramePr
oxy. | 150 // FIXME: These will need to change to WebFrame when we introduce WebFramePr
oxy. |
| 145 RefPtr<LocalFrame> m_frame; | 151 RefPtr<LocalFrame> m_frame; |
| 146 | 152 |
| 147 WebFrameClient* m_client; | 153 WebFrameClient* m_client; |
| 154 OwnPtr<MojoFetcher> m_fetcher; |
| 148 | 155 |
| 149 // Stores the additional input events offset and scale when device metrics e
mulation is enabled. | 156 // Stores the additional input events offset and scale when device metrics e
mulation is enabled. |
| 150 IntSize m_inputEventsOffsetForEmulation; | 157 IntSize m_inputEventsOffsetForEmulation; |
| 151 float m_inputEventsScaleFactorForEmulation; | 158 float m_inputEventsScaleFactorForEmulation; |
| 152 }; | 159 }; |
| 153 | 160 |
| 154 DEFINE_TYPE_CASTS(WebLocalFrameImpl, WebFrame, frame, frame->isWebLocalFrame(),
frame.isWebLocalFrame()); | 161 DEFINE_TYPE_CASTS(WebLocalFrameImpl, WebFrame, frame, frame->isWebLocalFrame(),
frame.isWebLocalFrame()); |
| 155 | 162 |
| 156 } // namespace blink | 163 } // namespace blink |
| 157 | 164 |
| 158 #endif // SKY_ENGINE_WEB_WEBLOCALFRAMEIMPL_H_ | 165 #endif // SKY_ENGINE_WEB_WEBLOCALFRAMEIMPL_H_ |
| OLD | NEW |