OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
49 class GestureEvent; | 49 class GestureEvent; |
50 class HTMLPlugInElement; | 50 class HTMLPlugInElement; |
51 class IntRect; | 51 class IntRect; |
52 class KeyboardEvent; | 52 class KeyboardEvent; |
53 class MouseEvent; | 53 class MouseEvent; |
54 class PlatformGestureEvent; | 54 class PlatformGestureEvent; |
55 class ResourceError; | 55 class ResourceError; |
56 class ResourceResponse; | 56 class ResourceResponse; |
| 57 class ScriptController; |
57 class ScrollbarGroup; | 58 class ScrollbarGroup; |
58 class TouchEvent; | 59 class TouchEvent; |
59 class WebPlugin; | 60 class WebPlugin; |
60 class WebPluginLoadObserver; | 61 class WebPluginLoadObserver; |
61 class WebExternalTextureLayer; | 62 class WebExternalTextureLayer; |
62 class WheelEvent; | 63 class WheelEvent; |
63 class Widget; | 64 class Widget; |
64 struct WebPrintParams; | 65 struct WebPrintParams; |
65 | 66 |
66 class WebPluginContainerImpl final | 67 class WebPluginContainerImpl final : public PluginView, public WebPluginContaine
r, public FrameDestructionObserver { |
67 : public PluginView | 68 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerImpl); |
68 , public WebPluginContainer | 69 public: |
69 #if !ENABLE(OILPAN) | 70 static PassRefPtrWillBeRawPtr<WebPluginContainerImpl> create(HTMLPlugInEleme
nt* element, WebPlugin* webPlugin) |
70 , public FrameDestructionObserver | |
71 #endif | |
72 { | 71 { |
73 public: | 72 return adoptRefWillBeNoop(new WebPluginContainerImpl(element, webPlugin)
); |
74 static PassRefPtr<WebPluginContainerImpl> create(HTMLPlugInElement* element,
WebPlugin* webPlugin) | |
75 { | |
76 return adoptRef(new WebPluginContainerImpl(element, webPlugin)); | |
77 } | 73 } |
78 | 74 |
79 // PluginView methods | 75 // PluginView methods |
80 virtual WebLayer* platformLayer() const override; | 76 virtual WebLayer* platformLayer() const override; |
81 virtual v8::Local<v8::Object> scriptableObject(v8::Isolate*) override; | 77 virtual v8::Local<v8::Object> scriptableObject(v8::Isolate*) override; |
82 virtual bool getFormValue(String&) override; | 78 virtual bool getFormValue(String&) override; |
83 virtual bool supportsKeyboardFocus() const override; | 79 virtual bool supportsKeyboardFocus() const override; |
84 virtual bool supportsInputMethod() const override; | 80 virtual bool supportsInputMethod() const override; |
85 virtual bool canProcessDrag() const override; | 81 virtual bool canProcessDrag() const override; |
86 virtual bool wantsWheelEvents() override; | 82 virtual bool wantsWheelEvents() override; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 158 |
163 void willDestroyPluginLoadObserver(WebPluginLoadObserver*); | 159 void willDestroyPluginLoadObserver(WebPluginLoadObserver*); |
164 | 160 |
165 ScrollbarGroup* scrollbarGroup(); | 161 ScrollbarGroup* scrollbarGroup(); |
166 | 162 |
167 void willStartLiveResize(); | 163 void willStartLiveResize(); |
168 void willEndLiveResize(); | 164 void willEndLiveResize(); |
169 | 165 |
170 bool paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect
&, const IntRect&); | 166 bool paintCustomOverhangArea(GraphicsContext*, const IntRect&, const IntRect
&, const IntRect&); |
171 | 167 |
172 #if ENABLE(OILPAN) | 168 virtual void trace(Visitor*) override; |
173 virtual void detach() override; | 169 virtual void dispose() override; |
174 #endif | 170 |
| 171 virtual LocalFrame* pluginFrame() const override { return frame(); } |
175 | 172 |
176 private: | 173 private: |
177 WebPluginContainerImpl(HTMLPlugInElement*, WebPlugin*); | 174 WebPluginContainerImpl(HTMLPlugInElement*, WebPlugin*); |
178 virtual ~WebPluginContainerImpl(); | 175 virtual ~WebPluginContainerImpl(); |
179 | 176 |
180 void handleMouseEvent(MouseEvent*); | 177 void handleMouseEvent(MouseEvent*); |
181 void handleDragEvent(MouseEvent*); | 178 void handleDragEvent(MouseEvent*); |
182 void handleWheelEvent(WheelEvent*); | 179 void handleWheelEvent(WheelEvent*); |
183 void handleKeyboardEvent(KeyboardEvent*); | 180 void handleKeyboardEvent(KeyboardEvent*); |
184 void handleTouchEvent(TouchEvent*); | 181 void handleTouchEvent(TouchEvent*); |
185 void handleGestureEvent(GestureEvent*); | 182 void handleGestureEvent(GestureEvent*); |
186 | 183 |
187 void synthesizeMouseEventIfPossible(TouchEvent*); | 184 void synthesizeMouseEventIfPossible(TouchEvent*); |
188 | 185 |
189 void focusPlugin(); | 186 void focusPlugin(); |
190 | 187 |
191 void calculateGeometry( | 188 void calculateGeometry( |
192 const IntRect& frameRect, | 189 const IntRect& frameRect, |
193 IntRect& windowRect, | 190 IntRect& windowRect, |
194 IntRect& clipRect, | 191 IntRect& clipRect, |
195 Vector<IntRect>& cutOutRects); | 192 Vector<IntRect>& cutOutRects); |
196 IntRect windowClipRect() const; | 193 IntRect windowClipRect() const; |
197 void windowCutOutRects( | 194 void windowCutOutRects( |
198 const IntRect& frameRect, | 195 const IntRect& frameRect, |
199 Vector<IntRect>& cutOutRects); | 196 Vector<IntRect>& cutOutRects); |
200 | 197 |
201 #if ENABLE(OILPAN) | 198 RawPtrWillBeMember<HTMLPlugInElement> m_element; |
202 // FIXME: Oilpan: consider moving Widget to the heap, allowing this | |
203 // container object to be a FrameDestructionObserver. And thereby | |
204 // keep a traced member reference to the frame rather than as a | |
205 // bare pointer. Instead, the owning object (HTMLFrameOwnerElement) | |
206 // explicitly deletes this object when it is disconnected from its | |
207 // frame. Any access to an invalid frame via this bare pointer | |
208 // is therefore not possible. | |
209 // | |
210 // See the HTMLFrameOwnerElement::disconnectContentFrame comment for | |
211 // (even) more. | |
212 LocalFrame* m_frame; | |
213 | |
214 LocalFrame* frame() const { return m_frame; } | |
215 #endif | |
216 | |
217 // FIXME: see above; for the time being, a bare pointer to the owning | |
218 // HTMLPlugInElement and managed as such. | |
219 HTMLPlugInElement* m_element; | |
220 WebPlugin* m_webPlugin; | 199 WebPlugin* m_webPlugin; |
221 Vector<WebPluginLoadObserver*> m_pluginLoadObservers; | 200 Vector<WebPluginLoadObserver*> m_pluginLoadObservers; |
222 | 201 |
223 WebLayer* m_webLayer; | 202 WebLayer* m_webLayer; |
224 | 203 |
225 // The associated scrollbar group object, created lazily. Used for Pepper | 204 // The associated scrollbar group object, created lazily. Used for Pepper |
226 // scrollbars. | 205 // scrollbars. |
227 OwnPtr<ScrollbarGroup> m_scrollbarGroup; | 206 OwnPtr<ScrollbarGroup> m_scrollbarGroup; |
228 | 207 |
229 TouchEventRequestType m_touchEventRequestType; | 208 TouchEventRequestType m_touchEventRequestType; |
230 bool m_wantsWheelEvents; | 209 bool m_wantsWheelEvents; |
231 }; | 210 }; |
232 | 211 |
233 DEFINE_TYPE_CASTS(WebPluginContainerImpl, Widget, widget, widget->isPluginContai
ner(), widget.isPluginContainer()); | 212 DEFINE_TYPE_CASTS(WebPluginContainerImpl, Widget, widget, widget->isPluginContai
ner(), widget.isPluginContainer()); |
234 // Unlike Widget, we need not worry about object type for container. | 213 // Unlike Widget, we need not worry about object type for container. |
235 // WebPluginContainerImpl is the only subclass of WebPluginContainer. | 214 // WebPluginContainerImpl is the only subclass of WebPluginContainer. |
236 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebPluginContainer, container, true, t
rue); | 215 DEFINE_TYPE_CASTS(WebPluginContainerImpl, WebPluginContainer, container, true, t
rue); |
237 | 216 |
238 } // namespace blink | 217 } // namespace blink |
239 | 218 |
240 #endif | 219 #endif |
OLD | NEW |