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

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

Issue 1219013005: Fix virtual/override/final usage in Source/core/html/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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/HTMLLegendElement.h ('k') | Source/core/html/HTMLMapElement.h » ('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) 2003, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google Inc. All rights 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // types might better be handled by a separate class, but dynamically 54 // types might better be handled by a separate class, but dynamically
55 // changing @rel makes it harder to move such a design so we are 55 // changing @rel makes it harder to move such a design so we are
56 // sticking current way so far. 56 // sticking current way so far.
57 // 57 //
58 class LinkStyle final : public LinkResource, ResourceOwner<StyleSheetResource> { 58 class LinkStyle final : public LinkResource, ResourceOwner<StyleSheetResource> {
59 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(LinkStyle); 59 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(LinkStyle);
60 public: 60 public:
61 static PassOwnPtrWillBeRawPtr<LinkStyle> create(HTMLLinkElement* owner); 61 static PassOwnPtrWillBeRawPtr<LinkStyle> create(HTMLLinkElement* owner);
62 62
63 explicit LinkStyle(HTMLLinkElement* owner); 63 explicit LinkStyle(HTMLLinkElement* owner);
64 virtual ~LinkStyle(); 64 ~LinkStyle() override;
65 65
66 virtual Type type() const override { return Style; } 66 Type type() const override { return Style; }
67 virtual void process() override; 67 void process() override;
68 virtual void ownerRemoved() override; 68 void ownerRemoved() override;
69 virtual bool hasLoaded() const override { return m_loadedSheet; } 69 bool hasLoaded() const override { return m_loadedSheet; }
70 DECLARE_VIRTUAL_TRACE(); 70 DECLARE_VIRTUAL_TRACE();
71 71
72 void startLoadingDynamicSheet(); 72 void startLoadingDynamicSheet();
73 void notifyLoadedSheetAndAllCriticalSubresources(Node::LoadedSheetErrorStatu s); 73 void notifyLoadedSheetAndAllCriticalSubresources(Node::LoadedSheetErrorStatu s);
74 bool sheetLoaded(); 74 bool sheetLoaded();
75 75
76 void setDisabledState(bool); 76 void setDisabledState(bool);
77 void setSheetTitle(const String&); 77 void setSheetTitle(const String&);
78 78
79 bool styleSheetIsLoading() const; 79 bool styleSheetIsLoading() const;
80 bool hasSheet() const { return m_sheet; } 80 bool hasSheet() const { return m_sheet; }
81 bool isDisabled() const { return m_disabledState == Disabled; } 81 bool isDisabled() const { return m_disabledState == Disabled; }
82 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript ; } 82 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript ; }
83 bool isUnset() const { return m_disabledState == Unset; } 83 bool isUnset() const { return m_disabledState == Unset; }
84 84
85 CSSStyleSheet* sheet() const { return m_sheet.get(); } 85 CSSStyleSheet* sheet() const { return m_sheet.get(); }
86 86
87 private: 87 private:
88 // From StyleSheetResourceClient 88 // From StyleSheetResourceClient
89 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) override; 89 void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) override;
90 90
91 enum DisabledState { 91 enum DisabledState {
92 Unset, 92 Unset,
93 EnabledViaScript, 93 EnabledViaScript,
94 Disabled 94 Disabled
95 }; 95 };
96 96
97 enum PendingSheetType { 97 enum PendingSheetType {
98 None, 98 None,
99 NonBlocking, 99 NonBlocking,
(...skipping 19 matching lines...) Expand all
119 bool m_firedLoad; 119 bool m_firedLoad;
120 bool m_loadedSheet; 120 bool m_loadedSheet;
121 bool m_fetchFollowingCORS; 121 bool m_fetchFollowingCORS;
122 }; 122 };
123 123
124 124
125 class CORE_EXPORT HTMLLinkElement final : public HTMLElement, public LinkLoaderC lient { 125 class CORE_EXPORT HTMLLinkElement final : public HTMLElement, public LinkLoaderC lient {
126 DEFINE_WRAPPERTYPEINFO(); 126 DEFINE_WRAPPERTYPEINFO();
127 public: 127 public:
128 static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool create dByParser); 128 static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool create dByParser);
129 virtual ~HTMLLinkElement(); 129 ~HTMLLinkElement() override;
130 130
131 KURL href() const; 131 KURL href() const;
132 const AtomicString& rel() const; 132 const AtomicString& rel() const;
133 String media() const { return m_media; } 133 String media() const { return m_media; }
134 String typeValue() const { return m_type; } 134 String typeValue() const { return m_type; }
135 String asValue() const { return m_as; } 135 String asValue() const { return m_as; }
136 const LinkRelAttribute& relAttribute() const { return m_relAttribute; } 136 const LinkRelAttribute& relAttribute() const { return m_relAttribute; }
137 137
138 const AtomicString& type() const; 138 const AtomicString& type() const;
139 139
(...skipping 14 matching lines...) Expand all
154 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl edViaScript(); } 154 bool isEnabledViaScript() const { return linkStyle() && linkStyle()->isEnabl edViaScript(); }
155 155
156 DOMSettableTokenList* sizes() const; 156 DOMSettableTokenList* sizes() const;
157 157
158 void dispatchPendingEvent(LinkEventSender*); 158 void dispatchPendingEvent(LinkEventSender*);
159 void scheduleEvent(); 159 void scheduleEvent();
160 void dispatchEventImmediately(); 160 void dispatchEventImmediately();
161 static void dispatchPendingLoadEvents(); 161 static void dispatchPendingLoadEvents();
162 162
163 // From LinkLoaderClient 163 // From LinkLoaderClient
164 virtual bool shouldLoadLink() override; 164 bool shouldLoadLink() override;
165 165
166 // For LinkStyle 166 // For LinkStyle
167 bool loadLink(const String& type, const String& as, const KURL&); 167 bool loadLink(const String& type, const String& as, const KURL&);
168 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); } 168 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); }
169 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); } 169 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); }
170 bool isCreatedByParser() const { return m_createdByParser; } 170 bool isCreatedByParser() const { return m_createdByParser; }
171 171
172 // Parse the icon size attribute into |iconSizes|, make this method public 172 // Parse the icon size attribute into |iconSizes|, make this method public
173 // visible for testing purpose. 173 // visible for testing purpose.
174 static void parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes); 174 static void parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes);
175 175
176 DECLARE_VIRTUAL_TRACE(); 176 DECLARE_VIRTUAL_TRACE();
177 177
178 private: 178 private:
179 virtual void attributeWillChange(const QualifiedName&, const AtomicString& o ldValue, const AtomicString& newValue) override; 179 void attributeWillChange(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue) override;
180 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; 180 void parseAttribute(const QualifiedName&, const AtomicString&) override;
181 181
182 LinkStyle* linkStyle() const; 182 LinkStyle* linkStyle() const;
183 LinkImport* linkImport() const; 183 LinkImport* linkImport() const;
184 LinkResource* linkResourceToProcess(); 184 LinkResource* linkResourceToProcess();
185 185
186 void process(); 186 void process();
187 static void processCallback(Node*); 187 static void processCallback(Node*);
188 188
189 // From Node and subclassses 189 // From Node and subclassses
190 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; 190 InsertionNotificationRequest insertedInto(ContainerNode*) override;
191 virtual void removedFrom(ContainerNode*) override; 191 void removedFrom(ContainerNode*) override;
192 virtual bool isURLAttribute(const Attribute&) const override; 192 bool isURLAttribute(const Attribute&) const override;
193 virtual bool hasLegalLinkAttribute(const QualifiedName&) const override; 193 bool hasLegalLinkAttribute(const QualifiedName&) const override;
194 virtual const QualifiedName& subResourceAttributeName() const override; 194 const QualifiedName& subResourceAttributeName() const override;
195 virtual bool sheetLoaded() override; 195 bool sheetLoaded() override;
196 virtual void notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorSta tus) override; 196 void notifyLoadedSheetAndAllCriticalSubresources(LoadedSheetErrorStatus) ove rride;
197 virtual void startLoadingDynamicSheet() override; 197 void startLoadingDynamicSheet() override;
198 virtual void finishParsingChildren() override; 198 void finishParsingChildren() override;
199 199
200 // From LinkLoaderClient 200 // From LinkLoaderClient
201 virtual void linkLoaded() override; 201 void linkLoaded() override;
202 virtual void linkLoadingErrored() override; 202 void linkLoadingErrored() override;
203 virtual void didStartLinkPrerender() override; 203 void didStartLinkPrerender() override;
204 virtual void didStopLinkPrerender() override; 204 void didStopLinkPrerender() override;
205 virtual void didSendLoadForLinkPrerender() override; 205 void didSendLoadForLinkPrerender() override;
206 virtual void didSendDOMContentLoadedForLinkPrerender() override; 206 void didSendDOMContentLoadedForLinkPrerender() override;
207 207
208 private: 208 private:
209 HTMLLinkElement(Document&, bool createdByParser); 209 HTMLLinkElement(Document&, bool createdByParser);
210 210
211 OwnPtrWillBeMember<LinkResource> m_link; 211 OwnPtrWillBeMember<LinkResource> m_link;
212 LinkLoader m_linkLoader; 212 LinkLoader m_linkLoader;
213 213
214 String m_type; 214 String m_type;
215 String m_as; 215 String m_as;
216 String m_media; 216 String m_media;
217 RefPtrWillBeMember<DOMSettableTokenList> m_sizes; 217 RefPtrWillBeMember<DOMSettableTokenList> m_sizes;
218 Vector<IntSize> m_iconSizes; 218 Vector<IntSize> m_iconSizes;
219 LinkRelAttribute m_relAttribute; 219 LinkRelAttribute m_relAttribute;
220 220
221 bool m_createdByParser; 221 bool m_createdByParser;
222 bool m_isInShadowTree; 222 bool m_isInShadowTree;
223 }; 223 };
224 224
225 } // namespace blink 225 } // namespace blink
226 226
227 #endif // HTMLLinkElement_h 227 #endif // HTMLLinkElement_h
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLegendElement.h ('k') | Source/core/html/HTMLMapElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698