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 | 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights |
5 * reserved. | 5 * reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 | 43 |
44 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { | 44 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { |
45 public: | 45 public: |
46 ~HTMLPlugInElement() override; | 46 ~HTMLPlugInElement() override; |
47 DECLARE_VIRTUAL_TRACE(); | 47 DECLARE_VIRTUAL_TRACE(); |
48 | 48 |
49 void resetInstance(); | 49 void resetInstance(); |
50 // TODO(dcheng): Consider removing this, since HTMLEmbedElementLegacyCall | 50 // TODO(dcheng): Consider removing this, since HTMLEmbedElementLegacyCall |
51 // and HTMLObjectElementLegacyCall usage is extremely low. | 51 // and HTMLObjectElementLegacyCall usage is extremely low. |
52 SharedPersistent<v8::Object>* pluginWrapper(); | 52 SharedPersistent<v8::Object>* pluginWrapper(); |
53 FrameViewBase* pluginWidget() const; | 53 PluginView* pluginWidget() const; |
54 PluginView* plugin() const; | |
dcheng
2017/04/04 07:20:12
Please add a TODO to clean this up (and note that
joelhockey
2017/04/04 23:39:05
Done.
| |
54 bool canProcessDrag() const; | 55 bool canProcessDrag() const; |
55 const String& url() const { return m_url; } | 56 const String& url() const { return m_url; } |
56 | 57 |
57 // Public for FrameView::addPartToUpdate() | 58 // Public for FrameView::addPartToUpdate() |
58 bool needsPluginUpdate() const { return m_needsPluginUpdate; } | 59 bool needsPluginUpdate() const { return m_needsPluginUpdate; } |
59 void setNeedsPluginUpdate(bool needsPluginUpdate) { | 60 void setNeedsPluginUpdate(bool needsPluginUpdate) { |
60 m_needsPluginUpdate = needsPluginUpdate; | 61 m_needsPluginUpdate = needsPluginUpdate; |
61 } | 62 } |
62 void updatePlugin(); | 63 void updatePlugin(); |
63 | 64 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 bool requireLayoutObject); | 153 bool requireLayoutObject); |
153 // Perform checks after we have determined that a plugin will be used to | 154 // Perform checks after we have determined that a plugin will be used to |
154 // show the object (i.e after allowedToLoadObject). | 155 // show the object (i.e after allowedToLoadObject). |
155 bool allowedToLoadPlugin(const KURL&, const String& mimeType); | 156 bool allowedToLoadPlugin(const KURL&, const String& mimeType); |
156 // Perform checks based on the URL and MIME-type of the object to load. | 157 // Perform checks based on the URL and MIME-type of the object to load. |
157 bool allowedToLoadObject(const KURL&, const String& mimeType); | 158 bool allowedToLoadObject(const KURL&, const String& mimeType); |
158 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); | 159 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); |
159 | 160 |
160 void setPlugin(PluginView*); | 161 void setPlugin(PluginView*); |
161 PluginView* releasePlugin(); | 162 PluginView* releasePlugin(); |
162 PluginView* ownedPlugin() const; | |
163 void setPersistedPlugin(PluginView*); | 163 void setPersistedPlugin(PluginView*); |
164 | 164 |
165 bool requestObjectInternal(const String& url, | 165 bool requestObjectInternal(const String& url, |
166 const String& mimeType, | 166 const String& mimeType, |
167 const Vector<String>& paramNames, | 167 const Vector<String>& paramNames, |
168 const Vector<String>& paramValues); | 168 const Vector<String>& paramValues); |
169 | 169 |
170 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; | 170 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; |
171 bool m_needsPluginUpdate; | 171 bool m_needsPluginUpdate; |
172 bool m_shouldPreferPlugInsForImages; | 172 bool m_shouldPreferPlugInsForImages; |
173 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && | 173 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && |
174 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to | 174 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to |
175 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). | 175 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). |
176 bool m_pluginIsAvailable = false; | 176 bool m_pluginIsAvailable = false; |
177 | 177 |
178 Member<PluginView> m_plugin; | |
178 // Normally the plugin is stored in HTMLFrameOwnerElement::m_widget. | 179 // Normally the plugin is stored in HTMLFrameOwnerElement::m_widget. |
179 // However, plugins can persist even when not rendered. In order to | 180 // However, plugins can persist even when not rendered. In order to |
180 // prevent confusing code which may assume that ownedWidget() != null | 181 // prevent confusing code which may assume that ownedWidget() != null |
181 // means the frame is active, we save off m_widget here while | 182 // means the frame is active, we save off m_widget here while |
182 // the plugin is persisting but not being displayed. | 183 // the plugin is persisting but not being displayed. |
183 Member<PluginView> m_persistedPlugin; | 184 Member<PluginView> m_persistedPlugin; |
184 }; | 185 }; |
185 | 186 |
186 inline bool isHTMLPlugInElement(const HTMLElement& element) { | 187 inline bool isHTMLPlugInElement(const HTMLElement& element) { |
187 return element.isPluginElement(); | 188 return element.isPluginElement(); |
188 } | 189 } |
189 | 190 |
190 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 191 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
191 | 192 |
192 } // namespace blink | 193 } // namespace blink |
193 | 194 |
194 #endif // HTMLPlugInElement_h | 195 #endif // HTMLPlugInElement_h |
OLD | NEW |