OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv
ed. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "bindings/core/v8/SharedPersistent.h" | 26 #include "bindings/core/v8/SharedPersistent.h" |
27 #include "core/CoreExport.h" | 27 #include "core/CoreExport.h" |
28 #include "core/html/HTMLFrameOwnerElement.h" | 28 #include "core/html/HTMLFrameOwnerElement.h" |
29 #include <v8.h> | 29 #include <v8.h> |
30 | 30 |
31 struct NPObject; | 31 struct NPObject; |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class HTMLImageLoader; | 35 class HTMLImageLoader; |
36 class PluginPlaceholder; | |
37 class LayoutEmbeddedObject; | 36 class LayoutEmbeddedObject; |
38 class LayoutPart; | 37 class LayoutPart; |
39 class Widget; | 38 class Widget; |
40 | 39 |
41 enum PreferPlugInsForImagesOption { | 40 enum PreferPlugInsForImagesOption { |
42 ShouldPreferPlugInsForImages, | 41 ShouldPreferPlugInsForImages, |
43 ShouldNotPreferPlugInsForImages | 42 ShouldNotPreferPlugInsForImages |
44 }; | 43 }; |
45 | 44 |
46 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { | 45 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { |
47 public: | 46 public: |
48 ~HTMLPlugInElement() override; | 47 ~HTMLPlugInElement() override; |
49 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
50 #if ENABLE(OILPAN) | 49 #if ENABLE(OILPAN) |
51 void disconnectContentFrame() override; | 50 void disconnectContentFrame() override; |
52 void shouldDisposePlugin(); | 51 void shouldDisposePlugin(); |
53 #endif | 52 #endif |
54 | 53 |
55 void resetInstance(); | 54 void resetInstance(); |
56 | |
57 // Returns the existing plugin widget, if there is one. | |
58 Widget* existingPluginWidget() const; | |
59 | |
60 // Returns the plugin widget, forcing layout and post-layout tasks | |
61 // to happen synchronously (e.g. for JS bindings). | |
62 // See also layoutPartForJSBindings(). | |
63 Widget* pluginWidgetForJSBindings(); | |
64 | |
65 SharedPersistent<v8::Object>* pluginWrapper(); | 55 SharedPersistent<v8::Object>* pluginWrapper(); |
| 56 Widget* pluginWidget() const; |
66 NPObject* getNPObject(); | 57 NPObject* getNPObject(); |
67 void setPluginFocus(bool focused); | 58 void setPluginFocus(bool focused); |
68 bool canProcessDrag() const; | 59 bool canProcessDrag() const; |
69 const String& url() const { return m_url; } | 60 const String& url() const { return m_url; } |
70 | 61 |
71 // Public for FrameView::addPartToUpdate() | 62 // Public for FrameView::addPartToUpdate() |
72 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } | 63 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } |
73 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = ne
edsWidgetUpdate; } | 64 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = ne
edsWidgetUpdate; } |
74 void updateWidget(); | 65 void updateWidget(); |
75 | 66 |
76 bool shouldAccelerate() const; | 67 bool shouldAccelerate() const; |
77 | 68 |
78 void requestPluginCreationWithoutLayoutObjectIfPossible(); | 69 void requestPluginCreationWithoutLayoutObjectIfPossible(); |
79 void createPluginWithoutLayoutObject(); | 70 void createPluginWithoutLayoutObject(); |
80 | 71 |
81 // Public for Internals::forcePluginPlaceholder. | |
82 bool usePlaceholderContent() const { return m_placeholder; } | |
83 void setPlaceholder(PassOwnPtrWillBeRawPtr<PluginPlaceholder>); | |
84 | |
85 protected: | 72 protected: |
86 HTMLPlugInElement(const QualifiedName& tagName, Document&, bool createdByPar
ser, PreferPlugInsForImagesOption); | 73 HTMLPlugInElement(const QualifiedName& tagName, Document&, bool createdByPar
ser, PreferPlugInsForImagesOption); |
87 | 74 |
88 // Node functions: | 75 // Node functions: |
89 void didMoveToNewDocument(Document& oldDocument) override; | 76 void didMoveToNewDocument(Document& oldDocument) override; |
90 | 77 |
91 // Element functions: | 78 // Element functions: |
92 bool isPresentationAttribute(const QualifiedName&) const override; | 79 bool isPresentationAttribute(const QualifiedName&) const override; |
93 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic
String&, MutableStylePropertySet*) override; | 80 void collectStyleForPresentationAttribute(const QualifiedName&, const Atomic
String&, MutableStylePropertySet*) override; |
94 | 81 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 bool pluginIsLoadable(const KURL&, const String& mimeType); | 134 bool pluginIsLoadable(const KURL&, const String& mimeType); |
148 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
; | 135 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
; |
149 | 136 |
150 void setPersistedPluginWidget(Widget*); | 137 void setPersistedPluginWidget(Widget*); |
151 | 138 |
152 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; | 139 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; |
153 NPObject* m_NPObject; | 140 NPObject* m_NPObject; |
154 bool m_needsWidgetUpdate; | 141 bool m_needsWidgetUpdate; |
155 bool m_shouldPreferPlugInsForImages; | 142 bool m_shouldPreferPlugInsForImages; |
156 | 143 |
157 OwnPtrWillBeMember<PluginPlaceholder> m_placeholder; | |
158 | |
159 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. | 144 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. |
160 // However, plugins can persist even when not rendered. In order to | 145 // However, plugins can persist even when not rendered. In order to |
161 // prevent confusing code which may assume that widget() != null | 146 // prevent confusing code which may assume that widget() != null |
162 // means the frame is active, we save off m_widget here while | 147 // means the frame is active, we save off m_widget here while |
163 // the plugin is persisting but not being displayed. | 148 // the plugin is persisting but not being displayed. |
164 RefPtrWillBeMember<Widget> m_persistedPluginWidget; | 149 RefPtrWillBeMember<Widget> m_persistedPluginWidget; |
165 }; | 150 }; |
166 | 151 |
167 inline bool isHTMLPlugInElement(const HTMLElement& element) | 152 inline bool isHTMLPlugInElement(const HTMLElement& element) |
168 { | 153 { |
169 return element.isPluginElement(); | 154 return element.isPluginElement(); |
170 } | 155 } |
171 | 156 |
172 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 157 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
173 | 158 |
174 } // namespace blink | 159 } // namespace blink |
175 | 160 |
176 #endif // HTMLPlugInElement_h | 161 #endif // HTMLPlugInElement_h |
OLD | NEW |