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

Side by Side Diff: Source/modules/accessibility/AXNodeObject.h

Issue 1227783004: Fix virtual/override/final usage in Source/modules/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 29 matching lines...) Expand all
40 class HTMLLabelElement; 40 class HTMLLabelElement;
41 class LayoutRect; 41 class LayoutRect;
42 class Node; 42 class Node;
43 43
44 class MODULES_EXPORT AXNodeObject : public AXObject { 44 class MODULES_EXPORT AXNodeObject : public AXObject {
45 protected: 45 protected:
46 AXNodeObject(Node*, AXObjectCacheImpl&); 46 AXNodeObject(Node*, AXObjectCacheImpl&);
47 47
48 public: 48 public:
49 static PassRefPtrWillBeRawPtr<AXNodeObject> create(Node*, AXObjectCacheImpl& ); 49 static PassRefPtrWillBeRawPtr<AXNodeObject> create(Node*, AXObjectCacheImpl& );
50 virtual ~AXNodeObject(); 50 ~AXNodeObject() override;
51 DECLARE_VIRTUAL_TRACE(); 51 DECLARE_VIRTUAL_TRACE();
52 52
53 protected: 53 protected:
54 // Protected data. 54 // Protected data.
55 AccessibilityRole m_ariaRole; 55 AccessibilityRole m_ariaRole;
56 bool m_childrenDirty; 56 bool m_childrenDirty;
57 #if ENABLE(ASSERT) 57 #if ENABLE(ASSERT)
58 bool m_initialized; 58 bool m_initialized;
59 #endif 59 #endif
60 60
61 virtual bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override; 61 bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override ;
62 virtual const AXObject* inheritsPresentationalRoleFrom() const override; 62 const AXObject* inheritsPresentationalRoleFrom() const override;
63 virtual AccessibilityRole determineAccessibilityRole(); 63 virtual AccessibilityRole determineAccessibilityRole();
64 AccessibilityRole determineAccessibilityRoleUtil(); 64 AccessibilityRole determineAccessibilityRoleUtil();
65 String accessibilityDescriptionForElements(WillBeHeapVector<RawPtrWillBeMemb er<Element>> &elements) const; 65 String accessibilityDescriptionForElements(WillBeHeapVector<RawPtrWillBeMemb er<Element>> &elements) const;
66 void alterSliderValue(bool increase); 66 void alterSliderValue(bool increase);
67 String ariaAccessibilityDescription() const; 67 String ariaAccessibilityDescription() const;
68 String ariaAutoComplete() const; 68 String ariaAutoComplete() const;
69 void ariaLabeledByElements(WillBeHeapVector<RawPtrWillBeMember<Element>>& el ements) const; 69 void ariaLabeledByElements(WillBeHeapVector<RawPtrWillBeMember<Element>>& el ements) const;
70 AccessibilityRole determineAriaRoleAttribute() const; 70 AccessibilityRole determineAriaRoleAttribute() const;
71 void tokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const; 71 void tokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const;
72 void elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element>>& el ements, const QualifiedName&) const; 72 void elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element>>& el ements, const QualifiedName&) const;
(...skipping 12 matching lines...) Expand all
85 AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const; 85 AccessibilityRole remapAriaRoleDueToParent(AccessibilityRole) const;
86 bool isNativeCheckboxOrRadio() const; 86 bool isNativeCheckboxOrRadio() const;
87 void setNode(Node*); 87 void setNode(Node*);
88 AXObject* correspondingControlForLabelElement() const; 88 AXObject* correspondingControlForLabelElement() const;
89 HTMLLabelElement* labelElementContainer() const; 89 HTMLLabelElement* labelElementContainer() const;
90 90
91 // 91 //
92 // Overridden from AXObject. 92 // Overridden from AXObject.
93 // 93 //
94 94
95 virtual void init() override; 95 void init() override;
96 virtual void detach() override; 96 void detach() override;
97 virtual bool isDetached() const override { return !m_node; } 97 bool isDetached() const override { return !m_node; }
98 virtual bool isAXNodeObject() const override final { return true; } 98 bool isAXNodeObject() const final { return true; }
99 99
100 // Check object role or purpose. 100 // Check object role or purpose.
101 virtual bool isAnchor() const override final; 101 bool isAnchor() const final;
102 virtual bool isControl() const override; 102 bool isControl() const override;
103 bool isControllingVideoElement() const; 103 bool isControllingVideoElement() const;
104 virtual bool isEmbeddedObject() const override final; 104 bool isEmbeddedObject() const final;
105 virtual bool isFieldset() const override final; 105 bool isFieldset() const final;
106 virtual bool isHeading() const override final; 106 bool isHeading() const final;
107 virtual bool isHovered() const override final; 107 bool isHovered() const final;
108 virtual bool isImage() const override final; 108 bool isImage() const final;
109 bool isImageButton() const; 109 bool isImageButton() const;
110 virtual bool isInputImage() const override final; 110 bool isInputImage() const final;
111 virtual bool isLink() const override final; 111 bool isLink() const final;
112 virtual bool isMenu() const override final; 112 bool isMenu() const final;
113 virtual bool isMenuButton() const override final; 113 bool isMenuButton() const final;
114 virtual bool isMeter() const override final; 114 bool isMeter() const final;
115 virtual bool isMultiSelectable() const override; 115 bool isMultiSelectable() const override;
116 bool isNativeImage() const; 116 bool isNativeImage() const;
117 virtual bool isNativeTextControl() const override final; 117 bool isNativeTextControl() const final;
118 virtual bool isNonNativeTextControl() const override final; 118 bool isNonNativeTextControl() const final;
119 virtual bool isPasswordField() const override final; 119 bool isPasswordField() const final;
120 virtual bool isProgressIndicator() const override; 120 bool isProgressIndicator() const override;
121 virtual bool isSlider() const override; 121 bool isSlider() const override;
122 virtual bool isNativeSlider() const override; 122 bool isNativeSlider() const override;
123 123
124 // Check object state. 124 // Check object state.
125 virtual bool isChecked() const override final; 125 bool isChecked() const final;
126 virtual bool isClickable() const override final; 126 bool isClickable() const final;
127 virtual bool isEnabled() const override; 127 bool isEnabled() const override;
128 virtual AccessibilityExpanded isExpanded() const override; 128 AccessibilityExpanded isExpanded() const override;
129 virtual bool isIndeterminate() const override final; 129 bool isIndeterminate() const final;
130 virtual bool isPressed() const override final; 130 bool isPressed() const final;
131 virtual bool isReadOnly() const override; 131 bool isReadOnly() const override;
132 virtual bool isRequired() const override final; 132 bool isRequired() const final;
133 133
134 // Check whether certain properties can be modified. 134 // Check whether certain properties can be modified.
135 virtual bool canSetFocusAttribute() const override; 135 bool canSetFocusAttribute() const override;
136 virtual bool canSetValueAttribute() const override; 136 bool canSetValueAttribute() const override;
137 137
138 // Properties of static elements. 138 // Properties of static elements.
139 virtual RGBA32 colorValue() const override final; 139 RGBA32 colorValue() const final;
140 virtual bool canvasHasFallbackContent() const override final; 140 bool canvasHasFallbackContent() const final;
141 virtual bool deprecatedExposesTitleUIElement() const override; 141 bool deprecatedExposesTitleUIElement() const override;
142 virtual int headingLevel() const override final; 142 int headingLevel() const final;
143 virtual unsigned hierarchicalLevel() const override final; 143 unsigned hierarchicalLevel() const final;
144 virtual String text() const override; 144 String text() const override;
145 virtual AXObject* deprecatedTitleUIElement() const override; 145 AXObject* deprecatedTitleUIElement() const override;
146 146
147 // Properties of interactive elements. 147 // Properties of interactive elements.
148 virtual AccessibilityButtonState checkboxOrRadioValue() const override final ; 148 AccessibilityButtonState checkboxOrRadioValue() const final;
149 virtual InvalidState invalidState() const override final; 149 InvalidState invalidState() const final;
150 // Only used when invalidState() returns InvalidStateOther. 150 // Only used when invalidState() returns InvalidStateOther.
151 virtual String ariaInvalidValue() const override final; 151 String ariaInvalidValue() const final;
152 virtual String valueDescription() const override; 152 String valueDescription() const override;
153 virtual float valueForRange() const override; 153 float valueForRange() const override;
154 virtual float maxValueForRange() const override; 154 float maxValueForRange() const override;
155 virtual float minValueForRange() const override; 155 float minValueForRange() const override;
156 virtual String stringValue() const override; 156 String stringValue() const override;
157 157
158 // ARIA attributes. 158 // ARIA attributes.
159 virtual String ariaDescribedByAttribute() const override final; 159 String ariaDescribedByAttribute() const final;
160 virtual String ariaLabeledByAttribute() const override final; 160 String ariaLabeledByAttribute() const final;
161 virtual AccessibilityRole ariaRoleAttribute() const override final; 161 AccessibilityRole ariaRoleAttribute() const final;
162 162
163 // Accessibility Text. 163 // Accessibility Text.
164 virtual String deprecatedTextUnderElement(TextUnderElementMode) const overri de; 164 String deprecatedTextUnderElement(TextUnderElementMode) const override;
165 virtual String deprecatedAccessibilityDescription() const override; 165 String deprecatedAccessibilityDescription() const override;
166 virtual String deprecatedTitle(TextUnderElementMode) const override; 166 String deprecatedTitle(TextUnderElementMode) const override;
167 virtual String deprecatedHelpText() const override; 167 String deprecatedHelpText() const override;
168 virtual String computedName() const override; 168 String computedName() const override;
169 169
170 // New AX name calculation. 170 // New AX name calculation.
171 virtual String textAlternative(bool recursive, bool inAriaLabelledByTraversa l, WillBeHeapHashSet<RawPtrWillBeMember<AXObject>>& visited, AXNameFrom*, WillBe HeapVector<RawPtrWillBeMember<AXObject>>* nameObjects) override; 171 String textAlternative(bool recursive, bool inAriaLabelledByTraversal, WillB eHeapHashSet<RawPtrWillBeMember<AXObject>>& visited, AXNameFrom*, WillBeHeapVect or<RawPtrWillBeMember<AXObject>>* nameObjects) override;
172 172
173 // Location and click point in frame-relative coordinates. 173 // Location and click point in frame-relative coordinates.
174 virtual LayoutRect elementRect() const override; 174 LayoutRect elementRect() const override;
175 175
176 // High-level accessibility tree access. 176 // High-level accessibility tree access.
177 virtual AXObject* computeParent() const override; 177 AXObject* computeParent() const override;
178 virtual AXObject* computeParentIfExists() const override; 178 AXObject* computeParentIfExists() const override;
179 179
180 // Low-level accessibility tree exploration. 180 // Low-level accessibility tree exploration.
181 virtual AXObject* firstChild() const override; 181 AXObject* firstChild() const override;
182 virtual AXObject* nextSibling() const override; 182 AXObject* nextSibling() const override;
183 virtual void addChildren() override; 183 void addChildren() override;
184 virtual bool canHaveChildren() const override; 184 bool canHaveChildren() const override;
185 void addChild(AXObject*); 185 void addChild(AXObject*);
186 void insertChild(AXObject*, unsigned index); 186 void insertChild(AXObject*, unsigned index);
187 187
188 // DOM and Render tree access. 188 // DOM and Render tree access.
189 virtual Element* actionElement() const override final; 189 Element* actionElement() const final;
190 virtual Element* anchorElement() const override; 190 Element* anchorElement() const override;
191 virtual Document* document() const override; 191 Document* document() const override;
192 virtual Node* node() const override { return m_node; } 192 Node* node() const override { return m_node; }
193 193
194 // Modify or take an action on an object. 194 // Modify or take an action on an object.
195 virtual void setFocused(bool) override final; 195 void setFocused(bool) final;
196 virtual void increment() override final; 196 void increment() final;
197 virtual void decrement() override final; 197 void decrement() final;
198 198
199 // Notifications that this object may have changed. 199 // Notifications that this object may have changed.
200 virtual void childrenChanged() override; 200 void childrenChanged() override;
201 virtual void selectionChanged() override final; 201 void selectionChanged() final;
202 virtual void textChanged() override; 202 void textChanged() override;
203 virtual void updateAccessibilityRole() override final; 203 void updateAccessibilityRole() final;
204 204
205 // Position in set and Size of set 205 // Position in set and Size of set
206 virtual int posInSet() const override; 206 int posInSet() const override;
207 virtual int setSize() const override; 207 int setSize() const override;
208 208
209 // Aria-owns. 209 // Aria-owns.
210 void computeAriaOwnsChildren(Vector<AXObject*>& ownedChildren); 210 void computeAriaOwnsChildren(Vector<AXObject*>& ownedChildren);
211 211
212 private: 212 private:
213 RawPtrWillBeMember<Node> m_node; 213 RawPtrWillBeMember<Node> m_node;
214 214
215 String alternativeTextForWebArea() const; 215 String alternativeTextForWebArea() const;
216 void alternativeText(WillBeHeapVector<OwnPtrWillBeMember<AccessibilityText>> &) const; 216 void alternativeText(WillBeHeapVector<OwnPtrWillBeMember<AccessibilityText>> &) const;
217 void ariaLabeledByText(WillBeHeapVector<OwnPtrWillBeMember<AccessibilityText >>&) const; 217 void ariaLabeledByText(WillBeHeapVector<OwnPtrWillBeMember<AccessibilityText >>&) const;
218 float stepValueForRange() const; 218 float stepValueForRange() const;
219 AXObject* findChildWithTagName(const HTMLQualifiedName&) const; 219 AXObject* findChildWithTagName(const HTMLQualifiedName&) const;
220 bool isDescendantOfElementType(const HTMLQualifiedName& tagName) const; 220 bool isDescendantOfElementType(const HTMLQualifiedName& tagName) const;
221 }; 221 };
222 222
223 DEFINE_AX_OBJECT_TYPE_CASTS(AXNodeObject, isAXNodeObject()); 223 DEFINE_AX_OBJECT_TYPE_CASTS(AXNodeObject, isAXNodeObject());
224 224
225 } // namespace blink 225 } // namespace blink
226 226
227 #endif // AXNodeObject_h 227 #endif // AXNodeObject_h
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXMockObject.h ('k') | Source/modules/accessibility/AXObjectCacheImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698