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

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

Issue 2845583002: Remove FrameViewBase as base class of RemoteFrameView. (Closed)
Patch Set: ConvertSelfToChild take FrameOrPlugin as arg Created 3 years, 7 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement { 44 class CORE_EXPORT HTMLPlugInElement : public HTMLFrameOwnerElement {
45 public: 45 public:
46 ~HTMLPlugInElement() override; 46 ~HTMLPlugInElement() override;
47 DECLARE_VIRTUAL_TRACE(); 47 DECLARE_VIRTUAL_TRACE();
48 48
49 void SetFocused(bool, WebFocusType) override; 49 void SetFocused(bool, WebFocusType) override;
50 void ResetInstance(); 50 void ResetInstance();
51 // TODO(dcheng): Consider removing this, since HTMLEmbedElementLegacyCall 51 // TODO(dcheng): Consider removing this, since HTMLEmbedElementLegacyCall
52 // and HTMLObjectElementLegacyCall usage is extremely low. 52 // and HTMLObjectElementLegacyCall usage is extremely low.
53 v8::Local<v8::Object> PluginWrapper(); 53 v8::Local<v8::Object> PluginWrapper();
54 // TODO(joelhockey): Clean up pluginWidget and plugin (maybe also 54 // TODO(joelhockey): Clean up PluginWidget and OwnedPlugin (maybe also
55 // pluginWrapper). It would be good to remove and/or rename some of these. 55 // PluginWrapper). It would be good to remove and/or rename some of these.
56 // pluginWidget and plugin both return the plugin that is stored on this 56 // PluginWidget and OwnedPlugin both return the plugin that is stored as
57 // element. However pluginWidget will synchronously create the plugin if 57 // widget in HTMLFrameOwnerElement. However PluginWidget will synchronously
58 // required by calling layoutPartForJSBindings. Possibly the pluginWidget 58 // create the plugin if required by calling LayoutPartForJSBindings.
59 // code can be inlined into pluginWrapper. 59 // Possibly the PluginWidget code can be inlined into PluginWrapper.
60 PluginView* PluginWidget() const; 60 PluginView* PluginWidget() const;
61 PluginView* Plugin() const; 61 PluginView* OwnedPlugin() const;
62 bool CanProcessDrag() const; 62 bool CanProcessDrag() const;
63 const String& Url() const { return url_; } 63 const String& Url() const { return url_; }
64 64
65 // Public for FrameView::addPartToUpdate() 65 // Public for FrameView::addPartToUpdate()
66 bool NeedsPluginUpdate() const { return needs_plugin_update_; } 66 bool NeedsPluginUpdate() const { return needs_plugin_update_; }
67 void SetNeedsPluginUpdate(bool needs_plugin_update) { 67 void SetNeedsPluginUpdate(bool needs_plugin_update) {
68 needs_plugin_update_ = needs_plugin_update; 68 needs_plugin_update_ = needs_plugin_update;
69 } 69 }
70 void UpdatePlugin(); 70 void UpdatePlugin();
71 71
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 const Vector<String>& param_values, 159 const Vector<String>& param_values,
160 bool use_fallback, 160 bool use_fallback,
161 bool require_layout_object); 161 bool require_layout_object);
162 // 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
163 // show the object (i.e after allowedToLoadObject). 163 // show the object (i.e after allowedToLoadObject).
164 bool AllowedToLoadPlugin(const KURL&, const String& mime_type); 164 bool AllowedToLoadPlugin(const KURL&, const String& mime_type);
165 // 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.
166 bool AllowedToLoadObject(const KURL&, const String& mime_type); 166 bool AllowedToLoadObject(const KURL&, const String& mime_type);
167 bool WouldLoadAsNetscapePlugin(const String& url, const String& service_type); 167 bool WouldLoadAsNetscapePlugin(const String& url, const String& service_type);
168 168
169 void SetPlugin(PluginView*);
170 PluginView* ReleasePlugin();
171 void SetPersistedPlugin(PluginView*); 169 void SetPersistedPlugin(PluginView*);
172 170
173 bool RequestObjectInternal(const String& url, 171 bool RequestObjectInternal(const String& url,
174 const String& mime_type, 172 const String& mime_type,
175 const Vector<String>& param_names, 173 const Vector<String>& param_names,
176 const Vector<String>& param_values); 174 const Vector<String>& param_values);
177 175
178 v8::Global<v8::Object> plugin_wrapper_; 176 v8::Global<v8::Object> plugin_wrapper_;
179 bool needs_plugin_update_; 177 bool needs_plugin_update_;
180 bool should_prefer_plug_ins_for_images_; 178 bool should_prefer_plug_ins_for_images_;
181 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && 179 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() &&
182 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to 180 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to
183 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). 181 // avoid accessing |layoutObject()| in layoutObjectIsFocusable().
184 bool plugin_is_available_ = false; 182 bool plugin_is_available_ = false;
185 183
186 Member<PluginView> plugin_; 184 // Normally the plugin is stored in HTMLFrameOwnerElement::widget_.
187 // Normally the plugin is stored in HTMLFrameOwnerElement::m_widget.
188 // However, plugins can persist even when not rendered. In order to 185 // However, plugins can persist even when not rendered. In order to
189 // prevent confusing code which may assume that ownedWidget() != null 186 // prevent confusing code which may assume that OwnedWidget() != null
haraken 2017/05/12 04:23:42 In my understanding, we should now rename OwnedWid
190 // means the frame is active, we save off m_widget here while 187 // means the frame is active, we save off widget_ here while
191 // the plugin is persisting but not being displayed. 188 // the plugin is persisting but not being displayed.
192 Member<PluginView> persisted_plugin_; 189 Member<PluginView> persisted_plugin_;
193 }; 190 };
194 191
195 inline bool IsHTMLPlugInElement(const HTMLElement& element) { 192 inline bool IsHTMLPlugInElement(const HTMLElement& element) {
196 return element.IsPluginElement(); 193 return element.IsPluginElement();
197 } 194 }
198 195
199 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); 196 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement);
200 197
201 } // namespace blink 198 } // namespace blink
202 199
203 #endif // HTMLPlugInElement_h 200 #endif // HTMLPlugInElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698