| 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 12 matching lines...) Expand all Loading... |
| 23 #ifndef HTMLPlugInElement_h | 23 #ifndef HTMLPlugInElement_h |
| 24 #define HTMLPlugInElement_h | 24 #define HTMLPlugInElement_h |
| 25 | 25 |
| 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 "core/layout/api/LayoutEmbeddedItem.h" | 29 #include "core/layout/api/LayoutEmbeddedItem.h" |
| 30 | 30 |
| 31 #include <v8.h> | 31 #include <v8.h> |
| 32 | 32 |
| 33 struct NPObject; | |
| 34 | |
| 35 namespace blink { | 33 namespace blink { |
| 36 | 34 |
| 37 class HTMLImageLoader; | 35 class HTMLImageLoader; |
| 38 class LayoutPart; | 36 class LayoutPart; |
| 39 class Widget; | 37 class Widget; |
| 40 | 38 |
| 41 enum PreferPlugInsForImagesOption { | 39 enum PreferPlugInsForImagesOption { |
| 42 ShouldPreferPlugInsForImages, | 40 ShouldPreferPlugInsForImages, |
| 43 ShouldNotPreferPlugInsForImages | 41 ShouldNotPreferPlugInsForImages |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { | 44 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { |
| 47 public: | 45 public: |
| 48 ~HTMLPlugInElement() override; | 46 ~HTMLPlugInElement() override; |
| 49 DECLARE_VIRTUAL_TRACE(); | 47 DECLARE_VIRTUAL_TRACE(); |
| 50 | 48 |
| 51 void resetInstance(); | 49 void resetInstance(); |
| 50 // TODO(dcheng): Consider removing this, since HTMLEmbedElementLegacyCall |
| 51 // and HTMLObjectElementLegacyCall usage is extremely low. |
| 52 SharedPersistent<v8::Object>* pluginWrapper(); | 52 SharedPersistent<v8::Object>* pluginWrapper(); |
| 53 Widget* pluginWidget() const; | 53 Widget* pluginWidget() const; |
| 54 NPObject* getNPObject(); | |
| 55 void setPluginFocus(bool focused); | |
| 56 bool canProcessDrag() const; | 54 bool canProcessDrag() const; |
| 57 const String& url() const { return m_url; } | 55 const String& url() const { return m_url; } |
| 58 | 56 |
| 59 // Public for FrameView::addPartToUpdate() | 57 // Public for FrameView::addPartToUpdate() |
| 60 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } | 58 bool needsWidgetUpdate() const { return m_needsWidgetUpdate; } |
| 61 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = ne
edsWidgetUpdate; } | 59 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { m_needsWidgetUpdate = ne
edsWidgetUpdate; } |
| 62 void updateWidget(); | 60 void updateWidget(); |
| 63 | 61 |
| 64 bool shouldAccelerate() const; | 62 bool shouldAccelerate() const; |
| 65 | 63 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Perform checks after we have determined that a plugin will be used to | 131 // Perform checks after we have determined that a plugin will be used to |
| 134 // show the object (i.e after allowedToLoadObject). | 132 // show the object (i.e after allowedToLoadObject). |
| 135 bool allowedToLoadPlugin(const KURL&, const String& mimeType); | 133 bool allowedToLoadPlugin(const KURL&, const String& mimeType); |
| 136 // Perform checks based on the URL and MIME-type of the object to load. | 134 // Perform checks based on the URL and MIME-type of the object to load. |
| 137 bool allowedToLoadObject(const KURL&, const String& mimeType); | 135 bool allowedToLoadObject(const KURL&, const String& mimeType); |
| 138 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
; | 136 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType)
; |
| 139 | 137 |
| 140 void setPersistedPluginWidget(Widget*); | 138 void setPersistedPluginWidget(Widget*); |
| 141 | 139 |
| 142 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; | 140 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; |
| 143 NPObject* m_NPObject; | |
| 144 bool m_needsWidgetUpdate; | 141 bool m_needsWidgetUpdate; |
| 145 bool m_shouldPreferPlugInsForImages; | 142 bool m_shouldPreferPlugInsForImages; |
| 146 | 143 |
| 147 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. | 144 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. |
| 148 // However, plugins can persist even when not rendered. In order to | 145 // However, plugins can persist even when not rendered. In order to |
| 149 // prevent confusing code which may assume that widget() != null | 146 // prevent confusing code which may assume that widget() != null |
| 150 // 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 |
| 151 // the plugin is persisting but not being displayed. | 148 // the plugin is persisting but not being displayed. |
| 152 RefPtrWillBeMember<Widget> m_persistedPluginWidget; | 149 RefPtrWillBeMember<Widget> m_persistedPluginWidget; |
| 153 }; | 150 }; |
| 154 | 151 |
| 155 inline bool isHTMLPlugInElement(const HTMLElement& element) | 152 inline bool isHTMLPlugInElement(const HTMLElement& element) |
| 156 { | 153 { |
| 157 return element.isPluginElement(); | 154 return element.isPluginElement(); |
| 158 } | 155 } |
| 159 | 156 |
| 160 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 157 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
| 161 | 158 |
| 162 } // namespace blink | 159 } // namespace blink |
| 163 | 160 |
| 164 #endif // HTMLPlugInElement_h | 161 #endif // HTMLPlugInElement_h |
| OLD | NEW |