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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
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 WebPluginContainerImpl_h | 31 #ifndef WebPluginContainerImpl_h |
32 #define WebPluginContainerImpl_h | 32 #define WebPluginContainerImpl_h |
33 | 33 |
| 34 #include "core/frame/FrameDestructionObserver.h" |
34 #include "core/plugins/PluginView.h" | 35 #include "core/plugins/PluginView.h" |
35 #include "platform/Widget.h" | 36 #include "platform/Widget.h" |
36 #include "public/web/WebPluginContainer.h" | 37 #include "public/web/WebPluginContainer.h" |
37 | 38 |
38 #include "wtf/OwnPtr.h" | 39 #include "wtf/OwnPtr.h" |
39 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
40 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
41 #include "wtf/text/WTFString.h" | 42 #include "wtf/text/WTFString.h" |
42 | 43 |
43 struct NPObject; | 44 struct NPObject; |
(...skipping 14 matching lines...) Expand all Loading... |
58 | 59 |
59 namespace blink { | 60 namespace blink { |
60 | 61 |
61 struct WebPrintParams; | 62 struct WebPrintParams; |
62 | 63 |
63 class ScrollbarGroup; | 64 class ScrollbarGroup; |
64 class WebPlugin; | 65 class WebPlugin; |
65 class WebPluginLoadObserver; | 66 class WebPluginLoadObserver; |
66 class WebExternalTextureLayer; | 67 class WebExternalTextureLayer; |
67 | 68 |
68 class WebPluginContainerImpl FINAL : public WebCore::PluginView, public WebPlugi
nContainer { | 69 class WebPluginContainerImpl FINAL : public WebCore::PluginView, public WebPlugi
nContainer, public WebCore::FrameDestructionObserver { |
69 public: | 70 public: |
70 static PassRefPtr<WebPluginContainerImpl> create(WebCore::HTMLPlugInElement*
element, WebPlugin* webPlugin) | 71 static PassRefPtr<WebPluginContainerImpl> create(WebCore::HTMLPlugInElement*
element, WebPlugin* webPlugin) |
71 { | 72 { |
72 return adoptRef(new WebPluginContainerImpl(element, webPlugin)); | 73 return adoptRef(new WebPluginContainerImpl(element, webPlugin)); |
73 } | 74 } |
74 | 75 |
75 // PluginView methods | 76 // PluginView methods |
76 virtual WebLayer* platformLayer() const OVERRIDE; | 77 virtual WebLayer* platformLayer() const OVERRIDE; |
77 virtual NPObject* scriptableObject() OVERRIDE; | 78 virtual NPObject* scriptableObject() OVERRIDE; |
78 virtual bool getFormValue(String&) OVERRIDE; | 79 virtual bool getFormValue(String&) OVERRIDE; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 156 |
156 void willDestroyPluginLoadObserver(WebPluginLoadObserver*); | 157 void willDestroyPluginLoadObserver(WebPluginLoadObserver*); |
157 | 158 |
158 ScrollbarGroup* scrollbarGroup(); | 159 ScrollbarGroup* scrollbarGroup(); |
159 | 160 |
160 void willStartLiveResize(); | 161 void willStartLiveResize(); |
161 void willEndLiveResize(); | 162 void willEndLiveResize(); |
162 | 163 |
163 bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRe
ct&, const WebCore::IntRect&, const WebCore::IntRect&); | 164 bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRe
ct&, const WebCore::IntRect&, const WebCore::IntRect&); |
164 | 165 |
| 166 #if ENABLE(OILPAN) |
| 167 virtual void detach() OVERRIDE; |
| 168 #endif |
| 169 |
165 private: | 170 private: |
166 WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPl
ugin); | 171 WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPl
ugin); |
167 virtual ~WebPluginContainerImpl(); | 172 virtual ~WebPluginContainerImpl(); |
168 | 173 |
169 void handleMouseEvent(WebCore::MouseEvent*); | 174 void handleMouseEvent(WebCore::MouseEvent*); |
170 void handleDragEvent(WebCore::MouseEvent*); | 175 void handleDragEvent(WebCore::MouseEvent*); |
171 void handleWheelEvent(WebCore::WheelEvent*); | 176 void handleWheelEvent(WebCore::WheelEvent*); |
172 void handleKeyboardEvent(WebCore::KeyboardEvent*); | 177 void handleKeyboardEvent(WebCore::KeyboardEvent*); |
173 void handleTouchEvent(WebCore::TouchEvent*); | 178 void handleTouchEvent(WebCore::TouchEvent*); |
174 void handleGestureEvent(WebCore::GestureEvent*); | 179 void handleGestureEvent(WebCore::GestureEvent*); |
175 | 180 |
176 void synthesizeMouseEventIfPossible(WebCore::TouchEvent*); | 181 void synthesizeMouseEventIfPossible(WebCore::TouchEvent*); |
177 | 182 |
178 void focusPlugin(); | 183 void focusPlugin(); |
179 | 184 |
180 void calculateGeometry(const WebCore::IntRect& frameRect, | 185 void calculateGeometry(const WebCore::IntRect& frameRect, |
181 WebCore::IntRect& windowRect, | 186 WebCore::IntRect& windowRect, |
182 WebCore::IntRect& clipRect, | 187 WebCore::IntRect& clipRect, |
183 Vector<WebCore::IntRect>& cutOutRects); | 188 Vector<WebCore::IntRect>& cutOutRects); |
184 WebCore::IntRect windowClipRect() const; | 189 WebCore::IntRect windowClipRect() const; |
185 void windowCutOutRects(const WebCore::IntRect& frameRect, | 190 void windowCutOutRects(const WebCore::IntRect& frameRect, |
186 Vector<WebCore::IntRect>& cutOutRects); | 191 Vector<WebCore::IntRect>& cutOutRects); |
187 | 192 |
| 193 // FIXME: Oilpan: consider moving Widget to the heap and turn this |
| 194 // into a traced member. For the time being, it is a bare pointer |
| 195 // of its owning PlugInElement and managed as such. |
188 WebCore::HTMLPlugInElement* m_element; | 196 WebCore::HTMLPlugInElement* m_element; |
189 WebPlugin* m_webPlugin; | 197 WebPlugin* m_webPlugin; |
190 Vector<WebPluginLoadObserver*> m_pluginLoadObservers; | 198 Vector<WebPluginLoadObserver*> m_pluginLoadObservers; |
191 | 199 |
192 WebLayer* m_webLayer; | 200 WebLayer* m_webLayer; |
193 | 201 |
194 // The associated scrollbar group object, created lazily. Used for Pepper | 202 // The associated scrollbar group object, created lazily. Used for Pepper |
195 // scrollbars. | 203 // scrollbars. |
196 OwnPtr<ScrollbarGroup> m_scrollbarGroup; | 204 OwnPtr<ScrollbarGroup> m_scrollbarGroup; |
197 | 205 |
198 TouchEventRequestType m_touchEventRequestType; | 206 TouchEventRequestType m_touchEventRequestType; |
199 bool m_wantsWheelEvents; | 207 bool m_wantsWheelEvents; |
200 }; | 208 }; |
201 | 209 |
202 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebCore::Widget, widget, widget->isPlu
ginContainer(), widget.isPluginContainer()); | 210 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebCore::Widget, widget, widget->isPlu
ginContainer(), widget.isPluginContainer()); |
203 // Unlike Widget, we need not worry about object type for container. | 211 // Unlike Widget, we need not worry about object type for container. |
204 // WebPluginContainerImpl is the only subclass of WebPluginContainer. | 212 // WebPluginContainerImpl is the only subclass of WebPluginContainer. |
205 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebPluginContainer, container, true, t
rue); | 213 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebPluginContainer, container, true, t
rue); |
206 | 214 |
207 } // namespace blink | 215 } // namespace blink |
208 | 216 |
209 #endif | 217 #endif |
OLD | NEW |