| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 needsPluginUpdate() const { return m_needsPluginUpdate; } |
| 59 void setNeedsWidgetUpdate(bool needsWidgetUpdate) { | 59 void setNeedsPluginUpdate(bool needsPluginUpdate) { |
| 60 m_needsWidgetUpdate = needsWidgetUpdate; | 60 m_needsPluginUpdate = needsPluginUpdate; |
| 61 } | 61 } |
| 62 void updateWidget(); | 62 void updatePlugin(); |
| 63 | 63 |
| 64 bool shouldAccelerate() const; | 64 bool shouldAccelerate() const; |
| 65 | 65 |
| 66 void requestPluginCreationWithoutLayoutObjectIfPossible(); | 66 void requestPluginCreationWithoutLayoutObjectIfPossible(); |
| 67 void createPluginWithoutLayoutObject(); | 67 void createPluginWithoutLayoutObject(); |
| 68 | 68 |
| 69 protected: | 69 protected: |
| 70 HTMLPlugInElement(const QualifiedName& tagName, | 70 HTMLPlugInElement(const QualifiedName& tagName, |
| 71 Document&, | 71 Document&, |
| 72 bool createdByParser, | 72 bool createdByParser, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // HTMLElement overrides: | 135 // HTMLElement overrides: |
| 136 bool hasCustomFocusLogic() const override; | 136 bool hasCustomFocusLogic() const override; |
| 137 bool isPluginElement() const final; | 137 bool isPluginElement() const final; |
| 138 | 138 |
| 139 // HTMLFrameOwnerElement overrides: | 139 // HTMLFrameOwnerElement overrides: |
| 140 void disconnectContentFrame() override; | 140 void disconnectContentFrame() override; |
| 141 | 141 |
| 142 // Return any existing LayoutPart without triggering relayout, or 0 if it | 142 // Return any existing LayoutPart without triggering relayout, or 0 if it |
| 143 // doesn't yet exist. | 143 // doesn't yet exist. |
| 144 virtual LayoutPart* existingLayoutPart() const = 0; | 144 virtual LayoutPart* existingLayoutPart() const = 0; |
| 145 virtual void updateWidgetInternal() = 0; | 145 virtual void updatePluginInternal() = 0; |
| 146 | 146 |
| 147 bool loadPlugin(const KURL&, | 147 bool loadPlugin(const KURL&, |
| 148 const String& mimeType, | 148 const String& mimeType, |
| 149 const Vector<String>& paramNames, | 149 const Vector<String>& paramNames, |
| 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(FrameViewBase*); | 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_needsPluginUpdate; |
| 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<FrameViewBase> 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 |