| 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 13 matching lines...) Expand all Loading... |
| 24 #ifndef HTMLPlugInElement_h | 24 #ifndef HTMLPlugInElement_h |
| 25 #define HTMLPlugInElement_h | 25 #define HTMLPlugInElement_h |
| 26 | 26 |
| 27 #include "bindings/core/v8/SharedPersistent.h" | 27 #include "bindings/core/v8/SharedPersistent.h" |
| 28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
| 29 #include "core/html/HTMLFrameOwnerElement.h" | 29 #include "core/html/HTMLFrameOwnerElement.h" |
| 30 #include "v8/include/v8.h" | 30 #include "v8/include/v8.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| 34 class FrameViewBase; |
| 34 class HTMLImageLoader; | 35 class HTMLImageLoader; |
| 35 class LayoutPart; | 36 class LayoutPart; |
| 36 class LayoutEmbeddedItem; | 37 class LayoutEmbeddedItem; |
| 37 class Widget; | |
| 38 | 38 |
| 39 enum PreferPlugInsForImagesOption { | 39 enum PreferPlugInsForImagesOption { |
| 40 ShouldPreferPlugInsForImages, | 40 ShouldPreferPlugInsForImages, |
| 41 ShouldNotPreferPlugInsForImages | 41 ShouldNotPreferPlugInsForImages |
| 42 }; | 42 }; |
| 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 Widget* pluginWidget() const; | 53 FrameViewBase* pluginWidget() const; |
| 54 bool canProcessDrag() const; | 54 bool canProcessDrag() const; |
| 55 const String& url() const { return m_url; } | 55 const String& url() const { return m_url; } |
| 56 | 56 |
| 57 // Public for FrameView::addPartToUpdate() | 57 // Public for FrameView::addPartToUpdate() |
| 58 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } | 58 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } |
| 59 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { | 59 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { |
| 60 m_needsWidgetUpdate = needsWidgetUpdate; | 60 m_needsWidgetUpdate = needsWidgetUpdate; |
| 61 } | 61 } |
| 62 void updateWidget(); | 62 void updateWidget(); |
| 63 | 63 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 const Vector<String>& paramValues, | 150 const Vector<String>& paramValues, |
| 151 bool useFallback, | 151 bool useFallback, |
| 152 bool requireLayoutObject); | 152 bool requireLayoutObject); |
| 153 // Perform checks after we have determined that a plugin will be used to | 153 // Perform checks after we have determined that a plugin will be used to |
| 154 // show the object (i.e after allowedToLoadObject). | 154 // show the object (i.e after allowedToLoadObject). |
| 155 bool allowedToLoadPlugin(const KURL&, const String& mimeType); | 155 bool allowedToLoadPlugin(const KURL&, const String& mimeType); |
| 156 // Perform checks based on the URL and MIME-type of the object to load. | 156 // Perform checks based on the URL and MIME-type of the object to load. |
| 157 bool allowedToLoadObject(const KURL&, const String& mimeType); | 157 bool allowedToLoadObject(const KURL&, const String& mimeType); |
| 158 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); | 158 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType); |
| 159 | 159 |
| 160 void setPersistedPluginWidget(Widget*); | 160 void setPersistedPluginWidget(FrameViewBase*); |
| 161 | 161 |
| 162 bool requestObjectInternal(const String& url, | 162 bool requestObjectInternal(const String& url, |
| 163 const String& mimeType, | 163 const String& mimeType, |
| 164 const Vector<String>& paramNames, | 164 const Vector<String>& paramNames, |
| 165 const Vector<String>& paramValues); | 165 const Vector<String>& paramValues); |
| 166 | 166 |
| 167 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; | 167 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; |
| 168 bool m_needsWidgetUpdate; | 168 bool m_needsWidgetUpdate; |
| 169 bool m_shouldPreferPlugInsForImages; | 169 bool m_shouldPreferPlugInsForImages; |
| 170 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && | 170 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && |
| 171 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to | 171 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to |
| 172 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). | 172 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). |
| 173 bool m_pluginIsAvailable = false; | 173 bool m_pluginIsAvailable = false; |
| 174 | 174 |
| 175 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. | 175 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. |
| 176 // However, plugins can persist even when not rendered. In order to | 176 // However, plugins can persist even when not rendered. In order to |
| 177 // prevent confusing code which may assume that widget() != null | 177 // prevent confusing code which may assume that widget() != null |
| 178 // means the frame is active, we save off m_widget here while | 178 // means the frame is active, we save off m_widget here while |
| 179 // the plugin is persisting but not being displayed. | 179 // the plugin is persisting but not being displayed. |
| 180 Member<Widget> m_persistedPluginWidget; | 180 Member<FrameViewBase> m_persistedPluginWidget; |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 inline bool isHTMLPlugInElement(const HTMLElement& element) { | 183 inline bool isHTMLPlugInElement(const HTMLElement& element) { |
| 184 return element.isPluginElement(); | 184 return element.isPluginElement(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 187 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
| 188 | 188 |
| 189 } // namespace blink | 189 } // namespace blink |
| 190 | 190 |
| 191 #endif // HTMLPlugInElement_h | 191 #endif // HTMLPlugInElement_h |
| OLD | NEW |