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

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

Issue 202153005: Add isHTMLPlugInElement() helpers for consistency with other HTML elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Keep virtual function Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 reserv ed. 4 * Copyright (C) 2004, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // EventTarget functions: 91 // EventTarget functions:
92 virtual void removeAllEventListeners() OVERRIDE FINAL; 92 virtual void removeAllEventListeners() OVERRIDE FINAL;
93 93
94 // Node functions: 94 // Node functions:
95 virtual bool canContainRangeEndPoint() const OVERRIDE { return false; } 95 virtual bool canContainRangeEndPoint() const OVERRIDE { return false; }
96 virtual bool willRespondToMouseClickEvents() OVERRIDE FINAL; 96 virtual bool willRespondToMouseClickEvents() OVERRIDE FINAL;
97 virtual void handleLocalEvents(Event*) OVERRIDE FINAL; 97 virtual void handleLocalEvents(Event*) OVERRIDE FINAL;
98 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE FINAL; 98 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE FINAL;
99 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE FINAL; 99 virtual void detach(const AttachContext& = AttachContext()) OVERRIDE FINAL;
100 virtual void finishParsingChildren() OVERRIDE FINAL; 100 virtual void finishParsingChildren() OVERRIDE FINAL;
101 virtual bool isPluginElement() const OVERRIDE FINAL;
102 101
103 // Element functions: 102 // Element functions:
104 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; 103 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
105 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE FINAL; 104 virtual void willRecalcStyle(StyleRecalcChange) OVERRIDE FINAL;
106 virtual bool supportsFocus() const OVERRIDE FINAL { return true; } 105 virtual bool supportsFocus() const OVERRIDE FINAL { return true; }
107 virtual bool rendererIsFocusable() const OVERRIDE FINAL; 106 virtual bool rendererIsFocusable() const OVERRIDE FINAL;
108 virtual bool isKeyboardFocusable() const OVERRIDE FINAL; 107 virtual bool isKeyboardFocusable() const OVERRIDE FINAL;
109 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE FINAL; 108 virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE FINAL;
110 virtual void didAddShadowRoot(ShadowRoot&) OVERRIDE FINAL; 109 virtual void didAddShadowRoot(ShadowRoot&) OVERRIDE FINAL;
111 110
112 // HTMLElement function: 111 // HTMLElement function:
113 virtual bool hasCustomFocusLogic() const OVERRIDE; 112 virtual bool hasCustomFocusLogic() const OVERRIDE;
113 virtual bool isPluginElement() const OVERRIDE FINAL;
114 114
115 // Return any existing RenderWidget without triggering relayout, or 0 if it 115 // Return any existing RenderWidget without triggering relayout, or 0 if it
116 // doesn't yet exist. 116 // doesn't yet exist.
117 virtual RenderWidget* existingRenderWidget() const = 0; 117 virtual RenderWidget* existingRenderWidget() const = 0;
118 virtual void updateWidgetInternal() = 0; 118 virtual void updateWidgetInternal() = 0;
119 119
120 enum DisplayState { 120 enum DisplayState {
121 Restarting, 121 Restarting,
122 RestartingWithPendingMouseClick, 122 RestartingWithPendingMouseClick,
123 Playing 123 Playing
124 }; 124 };
125 DisplayState displayState() const { return m_displayState; } 125 DisplayState displayState() const { return m_displayState; }
126 void setDisplayState(DisplayState state) { m_displayState = state; } 126 void setDisplayState(DisplayState state) { m_displayState = state; }
127 const String loadedMimeType() const; 127 const String loadedMimeType() const;
128 bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& p aramNames, const Vector<String>& paramValues, bool useFallback); 128 bool loadPlugin(const KURL&, const String& mimeType, const Vector<String>& p aramNames, const Vector<String>& paramValues, bool useFallback);
129 bool pluginIsLoadable(const KURL&, const String& mimeType); 129 bool pluginIsLoadable(const KURL&, const String& mimeType);
130 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType) ; 130 bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType) ;
131 131
132 mutable RefPtr<SharedPersistent<v8::Object> > m_pluginWrapper; 132 mutable RefPtr<SharedPersistent<v8::Object> > m_pluginWrapper;
133 NPObject* m_NPObject; 133 NPObject* m_NPObject;
134 bool m_isCapturingMouseEvents; 134 bool m_isCapturingMouseEvents;
135 bool m_inBeforeLoadEventHandler; 135 bool m_inBeforeLoadEventHandler;
136 bool m_needsWidgetUpdate; 136 bool m_needsWidgetUpdate;
137 bool m_shouldPreferPlugInsForImages; 137 bool m_shouldPreferPlugInsForImages;
138 DisplayState m_displayState; 138 DisplayState m_displayState;
139 }; 139 };
140 140
141 DEFINE_ELEMENT_TYPE_CASTS(HTMLPlugInElement, isPluginElement()); 141 inline bool isHTMLPlugInElement(const Element& element)
142 {
143 return element.isHTMLElement() && toHTMLElement(element).isPluginElement();
144 }
145
146 inline bool isHTMLPlugInElement(const HTMLElement& element)
147 {
148 return element.isPluginElement();
149 }
150
151 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLPlugInElement);
142 152
143 } // namespace WebCore 153 } // namespace WebCore
144 154
145 #endif // HTMLPlugInElement_h 155 #endif // HTMLPlugInElement_h
OLDNEW
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698