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 void removedFrom(ContainerNode* insertionPoint) override; | 72 void removedFrom(ContainerNode* insertionPoint) override; |
86 | 73 |
87 protected: | 74 protected: |
88 HTMLPlugInElement(const QualifiedName& tagName, Document&, bool createdByPar
ser, PreferPlugInsForImagesOption); | 75 HTMLPlugInElement(const QualifiedName& tagName, Document&, bool createdByPar
ser, PreferPlugInsForImagesOption); |
89 | 76 |
90 // Node functions: | 77 // Node functions: |
91 void didMoveToNewDocument(Document& oldDocument) override; | 78 void didMoveToNewDocument(Document& oldDocument) override; |
92 | 79 |
93 // Element functions: | 80 // Element functions: |
94 bool isPresentationAttribute(const QualifiedName&) const override; | 81 bool isPresentationAttribute(const QualifiedName&) const override; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 bool pluginIsLoadable(const KURL&, const String& mimeType); | 136 bool pluginIsLoadable(const KURL&, const String& mimeType); |
150 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
; | 137 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
; |
151 | 138 |
152 void setPersistedPluginWidget(Widget*); | 139 void setPersistedPluginWidget(Widget*); |
153 | 140 |
154 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; | 141 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; |
155 NPObject* m_NPObject; | 142 NPObject* m_NPObject; |
156 bool m_needsWidgetUpdate; | 143 bool m_needsWidgetUpdate; |
157 bool m_shouldPreferPlugInsForImages; | 144 bool m_shouldPreferPlugInsForImages; |
158 | 145 |
159 OwnPtrWillBeMember<PluginPlaceholder> m_placeholder; | |
160 | |
161 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. | 146 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. |
162 // However, plugins can persist even when not rendered. In order to | 147 // However, plugins can persist even when not rendered. In order to |
163 // prevent confusing code which may assume that widget() != null | 148 // prevent confusing code which may assume that widget() != null |
164 // means the frame is active, we save off m_widget here while | 149 // means the frame is active, we save off m_widget here while |
165 // the plugin is persisting but not being displayed. | 150 // the plugin is persisting but not being displayed. |
166 RefPtrWillBeMember<Widget> m_persistedPluginWidget; | 151 RefPtrWillBeMember<Widget> m_persistedPluginWidget; |
167 }; | 152 }; |
168 | 153 |
169 inline bool isHTMLPlugInElement(const HTMLElement& element) | 154 inline bool isHTMLPlugInElement(const HTMLElement& element) |
170 { | 155 { |
171 return element.isPluginElement(); | 156 return element.isPluginElement(); |
172 } | 157 } |
173 | 158 |
174 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 159 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
175 | 160 |
176 } // namespace blink | 161 } // namespace blink |
177 | 162 |
178 #endif // HTMLPlugInElement_h | 163 #endif // HTMLPlugInElement_h |
OLD | NEW |