| 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 // TODO(joelhockey): Can we remove pluginWidget and just have plugin? |
| 54 // The implementation of pluginWidget calls layoutPartForJSBindings. |
| 55 PluginView* pluginWidget() const; |
| 56 PluginView* plugin() const; |
| 54 bool canProcessDrag() const; | 57 bool canProcessDrag() const; |
| 55 const String& url() const { return m_url; } | 58 const String& url() const { return m_url; } |
| 56 | 59 |
| 57 // Public for FrameView::addPartToUpdate() | 60 // Public for FrameView::addPartToUpdate() |
| 58 bool needsPluginUpdate() const { return m_needsPluginUpdate; } | 61 bool needsPluginUpdate() const { return m_needsPluginUpdate; } |
| 59 void setNeedsPluginUpdate(bool needsPluginUpdate) { | 62 void setNeedsPluginUpdate(bool needsPluginUpdate) { |
| 60 m_needsPluginUpdate = needsPluginUpdate; | 63 m_needsPluginUpdate = needsPluginUpdate; |
| 61 } | 64 } |
| 62 void updatePlugin(); | 65 void updatePlugin(); |
| 63 | 66 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 bool requireLayoutObject); | 155 bool requireLayoutObject); |
| 153 // Perform checks after we have determined that a plugin will be used to | 156 // Perform checks after we have determined that a plugin will be used to |
| 154 // show the object (i.e after allowedToLoadObject). | 157 // show the object (i.e after allowedToLoadObject). |
| 155 bool allowedToLoadPlugin(const KURL&, const String& mimeType); | 158 bool allowedToLoadPlugin(const KURL&, const String& mimeType); |
| 156 // Perform checks based on the URL and MIME-type of the object to load. | 159 // Perform checks based on the URL and MIME-type of the object to load. |
| 157 bool allowedToLoadObject(const KURL&, const String& mimeType); | 160 bool allowedToLoadObject(const KURL&, const String& mimeType); |
| 158 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); | 161 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); |
| 159 | 162 |
| 160 void setPlugin(PluginView*); | 163 void setPlugin(PluginView*); |
| 161 PluginView* releasePlugin(); | 164 PluginView* releasePlugin(); |
| 162 PluginView* ownedPlugin() const; | |
| 163 void setPersistedPlugin(PluginView*); | 165 void setPersistedPlugin(PluginView*); |
| 164 | 166 |
| 165 bool requestObjectInternal(const String& url, | 167 bool requestObjectInternal(const String& url, |
| 166 const String& mimeType, | 168 const String& mimeType, |
| 167 const Vector<String>& paramNames, | 169 const Vector<String>& paramNames, |
| 168 const Vector<String>& paramValues); | 170 const Vector<String>& paramValues); |
| 169 | 171 |
| 170 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; | 172 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; |
| 171 bool m_needsPluginUpdate; | 173 bool m_needsPluginUpdate; |
| 172 bool m_shouldPreferPlugInsForImages; | 174 bool m_shouldPreferPlugInsForImages; |
| 173 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && | 175 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && |
| 174 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to | 176 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to |
| 175 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). | 177 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). |
| 176 bool m_pluginIsAvailable = false; | 178 bool m_pluginIsAvailable = false; |
| 177 | 179 |
| 180 Member<PluginView> m_plugin; |
| 178 // Normally the plugin is stored in HTMLFrameOwnerElement::m_widget. | 181 // Normally the plugin is stored in HTMLFrameOwnerElement::m_widget. |
| 179 // However, plugins can persist even when not rendered. In order to | 182 // However, plugins can persist even when not rendered. In order to |
| 180 // prevent confusing code which may assume that ownedWidget() != null | 183 // prevent confusing code which may assume that ownedWidget() != null |
| 181 // means the frame is active, we save off m_widget here while | 184 // means the frame is active, we save off m_widget here while |
| 182 // the plugin is persisting but not being displayed. | 185 // the plugin is persisting but not being displayed. |
| 183 Member<PluginView> m_persistedPlugin; | 186 Member<PluginView> m_persistedPlugin; |
| 184 }; | 187 }; |
| 185 | 188 |
| 186 inline bool isHTMLPlugInElement(const HTMLElement& element) { | 189 inline bool isHTMLPlugInElement(const HTMLElement& element) { |
| 187 return element.isPluginElement(); | 190 return element.isPluginElement(); |
| 188 } | 191 } |
| 189 | 192 |
| 190 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 193 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
| 191 | 194 |
| 192 } // namespace blink | 195 } // namespace blink |
| 193 | 196 |
| 194 #endif // HTMLPlugInElement_h | 197 #endif // HTMLPlugInElement_h |
| OLD | NEW |