| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 const AtomicString&, | 99 const AtomicString&, |
| 100 MutableStylePropertySet*) override; | 100 MutableStylePropertySet*) override; |
| 101 | 101 |
| 102 virtual bool HasFallbackContent() const; | 102 virtual bool HasFallbackContent() const; |
| 103 virtual bool UseFallbackContent() const; | 103 virtual bool UseFallbackContent() const; |
| 104 // Create or update the LayoutEmbeddedContent and return it, triggering layout | 104 // Create or update the LayoutEmbeddedContent and return it, triggering layout |
| 105 // if necessary. | 105 // if necessary. |
| 106 virtual LayoutEmbeddedContent* LayoutEmbeddedContentForJSBindings() const; | 106 virtual LayoutEmbeddedContent* LayoutEmbeddedContentForJSBindings() const; |
| 107 | 107 |
| 108 bool IsImageType(); | 108 bool IsImageType(); |
| 109 bool ShouldPreferPlugInsForImages() const { |
| 110 return should_prefer_plug_ins_for_images_; |
| 111 } |
| 109 LayoutEmbeddedItem GetLayoutEmbeddedItem() const; | 112 LayoutEmbeddedItem GetLayoutEmbeddedItem() const; |
| 110 bool AllowedToLoadFrameURL(const String& url); | 113 bool AllowedToLoadFrameURL(const String& url); |
| 111 bool RequestObject(const Vector<String>& param_names, | 114 bool RequestObject(const String& url, |
| 115 const String& mime_type, |
| 116 const Vector<String>& param_names, |
| 112 const Vector<String>& param_values); | 117 const Vector<String>& param_values); |
| 118 bool ShouldUsePlugin(const KURL&, |
| 119 const String& mime_type, |
| 120 bool has_fallback, |
| 121 bool& use_fallback); |
| 113 | 122 |
| 114 void DispatchErrorEvent(); | 123 void DispatchErrorEvent(); |
| 115 bool IsErrorplaceholder(); | 124 bool IsErrorplaceholder(); |
| 116 void LazyReattachIfNeeded(); | 125 void LazyReattachIfNeeded(); |
| 117 | 126 |
| 118 String service_type_; | 127 String service_type_; |
| 119 String url_; | 128 String url_; |
| 120 KURL loaded_url_; | 129 KURL loaded_url_; |
| 121 Member<HTMLImageLoader> image_loader_; | 130 Member<HTMLImageLoader> image_loader_; |
| 122 bool is_delaying_load_event_; | 131 bool is_delaying_load_event_; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 const String& mime_type, | 166 const String& mime_type, |
| 158 const Vector<String>& param_names, | 167 const Vector<String>& param_names, |
| 159 const Vector<String>& param_values, | 168 const Vector<String>& param_values, |
| 160 bool use_fallback, | 169 bool use_fallback, |
| 161 bool require_layout_object); | 170 bool require_layout_object); |
| 162 // Perform checks after we have determined that a plugin will be used to | 171 // Perform checks after we have determined that a plugin will be used to |
| 163 // show the object (i.e after allowedToLoadObject). | 172 // show the object (i.e after allowedToLoadObject). |
| 164 bool AllowedToLoadPlugin(const KURL&, const String& mime_type); | 173 bool AllowedToLoadPlugin(const KURL&, const String& mime_type); |
| 165 // Perform checks based on the URL and MIME-type of the object to load. | 174 // Perform checks based on the URL and MIME-type of the object to load. |
| 166 bool AllowedToLoadObject(const KURL&, const String& mime_type); | 175 bool AllowedToLoadObject(const KURL&, const String& mime_type); |
| 167 | 176 bool WouldLoadAsNetscapePlugin(const String& url, const String& service_type); |
| 168 enum class ObjectContentType { | |
| 169 kNone, | |
| 170 kImage, | |
| 171 kFrame, | |
| 172 kPlugin, | |
| 173 }; | |
| 174 ObjectContentType GetObjectContentType(); | |
| 175 | 177 |
| 176 void SetPersistedPlugin(PluginView*); | 178 void SetPersistedPlugin(PluginView*); |
| 177 | 179 |
| 178 bool RequestObjectInternal(const Vector<String>& param_names, | 180 bool RequestObjectInternal(const String& url, |
| 181 const String& mime_type, |
| 182 const Vector<String>& param_names, |
| 179 const Vector<String>& param_values); | 183 const Vector<String>& param_values); |
| 180 | 184 |
| 181 v8::Global<v8::Object> plugin_wrapper_; | 185 v8::Global<v8::Object> plugin_wrapper_; |
| 182 bool needs_plugin_update_; | 186 bool needs_plugin_update_; |
| 183 bool should_prefer_plug_ins_for_images_; | 187 bool should_prefer_plug_ins_for_images_; |
| 184 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && | 188 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && |
| 185 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to | 189 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to |
| 186 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). | 190 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). |
| 187 bool plugin_is_available_ = false; | 191 bool plugin_is_available_ = false; |
| 188 | 192 |
| 189 // Normally the plugin is stored in | 193 // Normally the plugin is stored in |
| 190 // HTMLFrameOwnerElement::embedded_content_view. However, plugins can persist | 194 // HTMLFrameOwnerElement::embedded_content_view. However, plugins can persist |
| 191 // even when not rendered. In order to prevent confusing code which may assume | 195 // even when not rendered. In order to prevent confusing code which may assume |
| 192 // that OwnedEmbeddedContentView() != null means the frame is active, we save | 196 // that OwnedEmbeddedContentView() != null means the frame is active, we save |
| 193 // off embedded_content_view_ here while the plugin is persisting but not | 197 // off embedded_content_view_ here while the plugin is persisting but not |
| 194 // being displayed. | 198 // being displayed. |
| 195 Member<PluginView> persisted_plugin_; | 199 Member<PluginView> persisted_plugin_; |
| 196 }; | 200 }; |
| 197 | 201 |
| 198 inline bool IsHTMLPlugInElement(const HTMLElement& element) { | 202 inline bool IsHTMLPlugInElement(const HTMLElement& element) { |
| 199 return element.IsPluginElement(); | 203 return element.IsPluginElement(); |
| 200 } | 204 } |
| 201 | 205 |
| 202 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); | 206 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); |
| 203 | 207 |
| 204 } // namespace blink | 208 } // namespace blink |
| 205 | 209 |
| 206 #endif // HTMLPlugInElement_h | 210 #endif // HTMLPlugInElement_h |
| OLD | NEW |