Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLPlugInElement.h

Issue 2949873005: Move ObjectContentType entirely to HTMLPlugInElement (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 const AtomicString&, 102 const AtomicString&,
103 MutableStylePropertySet*) override; 103 MutableStylePropertySet*) override;
104 104
105 virtual bool HasFallbackContent() const; 105 virtual bool HasFallbackContent() const;
106 virtual bool UseFallbackContent() const; 106 virtual bool UseFallbackContent() const;
107 // Create or update the LayoutEmbeddedContent and return it, triggering layout 107 // Create or update the LayoutEmbeddedContent and return it, triggering layout
108 // if necessary. 108 // if necessary.
109 virtual LayoutEmbeddedContent* LayoutEmbeddedContentForJSBindings() const; 109 virtual LayoutEmbeddedContent* LayoutEmbeddedContentForJSBindings() const;
110 110
111 bool IsImageType(); 111 bool IsImageType();
112 bool ShouldPreferPlugInsForImages() const {
113 return should_prefer_plug_ins_for_images_;
114 }
115 LayoutEmbeddedItem GetLayoutEmbeddedItem() const; 112 LayoutEmbeddedItem GetLayoutEmbeddedItem() const;
116 bool AllowedToLoadFrameURL(const String& url); 113 bool AllowedToLoadFrameURL(const String& url);
117 bool RequestObject(const String& url, 114 bool RequestObject(const Vector<String>& param_names,
118 const String& mime_type,
119 const Vector<String>& param_names,
120 const Vector<String>& param_values); 115 const Vector<String>& param_values);
121 bool ShouldUsePlugin(const KURL&,
122 const String& mime_type,
123 bool has_fallback,
124 bool& use_fallback);
125 116
126 void DispatchErrorEvent(); 117 void DispatchErrorEvent();
127 bool IsErrorplaceholder(); 118 bool IsErrorplaceholder();
128 void LazyReattachIfNeeded(); 119 void LazyReattachIfNeeded();
129 120
130 String service_type_; 121 String service_type_;
131 String url_; 122 String url_;
132 KURL loaded_url_; 123 KURL loaded_url_;
133 Member<HTMLImageLoader> image_loader_; 124 Member<HTMLImageLoader> image_loader_;
134 bool is_delaying_load_event_; 125 bool is_delaying_load_event_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 const String& mime_type, 160 const String& mime_type,
170 const Vector<String>& param_names, 161 const Vector<String>& param_names,
171 const Vector<String>& param_values, 162 const Vector<String>& param_values,
172 bool use_fallback, 163 bool use_fallback,
173 bool require_layout_object); 164 bool require_layout_object);
174 // Perform checks after we have determined that a plugin will be used to 165 // Perform checks after we have determined that a plugin will be used to
175 // show the object (i.e after allowedToLoadObject). 166 // show the object (i.e after allowedToLoadObject).
176 bool AllowedToLoadPlugin(const KURL&, const String& mime_type); 167 bool AllowedToLoadPlugin(const KURL&, const String& mime_type);
177 // Perform checks based on the URL and MIME-type of the object to load. 168 // Perform checks based on the URL and MIME-type of the object to load.
178 bool AllowedToLoadObject(const KURL&, const String& mime_type); 169 bool AllowedToLoadObject(const KURL&, const String& mime_type);
179 bool WouldLoadAsNetscapePlugin(const String& url, const String& service_type); 170
171 enum class ObjectContentType {
172 kNone,
173 kImage,
174 kFrame,
175 kPlugin,
176 };
177 ObjectContentType GetObjectContentType();
180 178
181 void SetPersistedPlugin(PluginView*); 179 void SetPersistedPlugin(PluginView*);
182 180
183 bool RequestObjectInternal(const String& url, 181 bool RequestObjectInternal(const Vector<String>& param_names,
184 const String& mime_type,
185 const Vector<String>& param_names,
186 const Vector<String>& param_values); 182 const Vector<String>& param_values);
187 183
188 v8::Global<v8::Object> plugin_wrapper_; 184 v8::Global<v8::Object> plugin_wrapper_;
189 bool needs_plugin_update_; 185 bool needs_plugin_update_;
190 bool should_prefer_plug_ins_for_images_; 186 bool should_prefer_plug_ins_for_images_;
191 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && 187 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() &&
192 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to 188 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to
193 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). 189 // avoid accessing |layoutObject()| in layoutObjectIsFocusable().
194 bool plugin_is_available_ = false; 190 bool plugin_is_available_ = false;
195 191
196 // Normally the plugin is stored in 192 // Normally the plugin is stored in
197 // HTMLFrameOwnerElement::embedded_content_view. However, plugins can persist 193 // HTMLFrameOwnerElement::embedded_content_view. However, plugins can persist
198 // even when not rendered. In order to prevent confusing code which may assume 194 // even when not rendered. In order to prevent confusing code which may assume
199 // that OwnedEmbeddedContentView() != null means the frame is active, we save 195 // that OwnedEmbeddedContentView() != null means the frame is active, we save
200 // off embedded_content_view_ here while the plugin is persisting but not 196 // off embedded_content_view_ here while the plugin is persisting but not
201 // being displayed. 197 // being displayed.
202 Member<PluginView> persisted_plugin_; 198 Member<PluginView> persisted_plugin_;
203 }; 199 };
204 200
205 inline bool IsHTMLPlugInElement(const HTMLElement& element) { 201 inline bool IsHTMLPlugInElement(const HTMLElement& element) {
206 return element.IsPluginElement(); 202 return element.IsPluginElement();
207 } 203 }
208 204
209 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); 205 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement);
210 206
211 } // namespace blink 207 } // namespace blink
212 208
213 #endif // HTMLPlugInElement_h 209 #endif // HTMLPlugInElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLObjectElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698