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

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

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

Powered by Google App Engine
This is Rietveld 408576698