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

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

Issue 2759063002: Remove most of Widget (FrameViewBase) class from HTMLPlugInElement. (Closed)
Patch Set: Fix shouldAccelerate Created 3 years, 9 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 13 matching lines...) Expand all
24 #ifndef HTMLPlugInElement_h 24 #ifndef HTMLPlugInElement_h
25 #define HTMLPlugInElement_h 25 #define HTMLPlugInElement_h
26 26
27 #include "bindings/core/v8/SharedPersistent.h" 27 #include "bindings/core/v8/SharedPersistent.h"
28 #include "core/CoreExport.h" 28 #include "core/CoreExport.h"
29 #include "core/html/HTMLFrameOwnerElement.h" 29 #include "core/html/HTMLFrameOwnerElement.h"
30 #include "v8/include/v8.h" 30 #include "v8/include/v8.h"
31 31
32 namespace blink { 32 namespace blink {
33 33
34 class FrameViewBase;
35 class HTMLImageLoader; 34 class HTMLImageLoader;
36 class LayoutPart; 35 class LayoutPart;
37 class LayoutEmbeddedItem; 36 class LayoutEmbeddedItem;
37 class PluginView;
38 38
39 enum PreferPlugInsForImagesOption { 39 enum PreferPlugInsForImagesOption {
40 ShouldPreferPlugInsForImages, 40 ShouldPreferPlugInsForImages,
41 ShouldNotPreferPlugInsForImages 41 ShouldNotPreferPlugInsForImages
42 }; 42 };
43 43
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();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 setPlugin(PluginView*);
161 PluginView* releasePlugin();
162 PluginView* ownedPlugin() const;
163 void setPersistedPlugin(PluginView*);
161 164
162 bool requestObjectInternal(const String& url, 165 bool requestObjectInternal(const String& url,
163 const String& mimeType, 166 const String& mimeType,
164 const Vector<String>& paramNames, 167 const Vector<String>& paramNames,
165 const Vector<String>& paramValues); 168 const Vector<String>& paramValues);
166 169
167 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper; 170 mutable RefPtr<SharedPersistent<v8::Object>> m_pluginWrapper;
168 bool m_needsPluginUpdate; 171 bool m_needsPluginUpdate;
169 bool m_shouldPreferPlugInsForImages; 172 bool m_shouldPreferPlugInsForImages;
170 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() && 173 // Represents |layoutObject() && layoutObject()->isEmbeddedObject() &&
171 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to 174 // !layoutEmbeddedItem().showsUnavailablePluginIndicator()|. We want to
172 // avoid accessing |layoutObject()| in layoutObjectIsFocusable(). 175 // avoid accessing |layoutObject()| in layoutObjectIsFocusable().
173 bool m_pluginIsAvailable = false; 176 bool m_pluginIsAvailable = false;
174 177
175 // Normally the Widget is stored in HTMLFrameOwnerElement::m_widget. 178 // Normally the plugin is stored in HTMLFrameOwnerElement::m_widget.
176 // However, plugins can persist even when not rendered. In order to 179 // However, plugins can persist even when not rendered. In order to
177 // prevent confusing code which may assume that widget() != null 180 // prevent confusing code which may assume that ownedWidget() != null
178 // means the frame is active, we save off m_widget here while 181 // means the frame is active, we save off m_widget here while
179 // the plugin is persisting but not being displayed. 182 // the plugin is persisting but not being displayed.
180 Member<FrameViewBase> m_persistedPluginWidget; 183 Member<PluginView> m_persistedPlugin;
181 }; 184 };
182 185
183 inline bool isHTMLPlugInElement(const HTMLElement& element) { 186 inline bool isHTMLPlugInElement(const HTMLElement& element) {
184 return element.isPluginElement(); 187 return element.isPluginElement();
185 } 188 }
186 189
187 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement); 190 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement);
188 191
189 } // namespace blink 192 } // namespace blink
190 193
191 #endif // HTMLPlugInElement_h 194 #endif // HTMLPlugInElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrameClient.h ('k') | third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698