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

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

Issue 1169023003: Oilpan: Prepare moving AccessibilityText to the heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.cpp ('k') | no next file » | 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) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 AXPressedState, 206 AXPressedState,
207 AXProtectedState, 207 AXProtectedState,
208 AXReadonlyState, 208 AXReadonlyState,
209 AXRequiredState, 209 AXRequiredState,
210 AXSelectableState, 210 AXSelectableState,
211 AXSelectedState, 211 AXSelectedState,
212 AXVerticalState, 212 AXVerticalState,
213 AXVisitedState 213 AXVisitedState
214 }; 214 };
215 215
216 struct AccessibilityText { 216 class AccessibilityText final : public NoBaseWillBeGarbageCollectedFinalized<Acc essibilityText> {
217 String text; 217 public:
218 AccessibilityTextSource textSource; 218 static PassOwnPtrWillBeRawPtr<AccessibilityText> create(const String& text, const AccessibilityTextSource& source)
219 RefPtr<AXObject> textElement; 219 {
220 return adoptPtrWillBeNoop(new AccessibilityText(text, source, nullptr));
221 }
222 static PassOwnPtrWillBeRawPtr<AccessibilityText> create(const String& t, con st AccessibilityTextSource& s, const RefPtrWillBeRawPtr<AXObject> element)
haraken 2015/06/11 11:10:55 t => text s => textSource
keishi 2015/06/22 16:52:07 Done.
223 {
224 return adoptPtrWillBeNoop(new AccessibilityText(t, s, nullptr));
225 }
220 226
221 AccessibilityText(const String& t, const AccessibilityTextSource& s) 227 String text() const { return m_text; }
222 : text(t) 228 AccessibilityTextSource textSource() const { return m_textSource; }
223 , textSource(s) 229 AXObject* textElement() const { return m_textElement.get(); }
230
231 DEFINE_INLINE_TRACE()
232 {
233 visitor->trace(m_textElement);
234 }
235
236 private:
237 AccessibilityText(const String& t, const AccessibilityTextSource& s, const P assRefPtrWillBeRawPtr<AXObject> element)
238 : m_text(t)
239 , m_textSource(s)
haraken 2015/06/11 11:10:55 Ditto.
keishi 2015/06/22 16:52:07 Done.
240 , m_textElement(element)
224 { } 241 { }
225 242
226 AccessibilityText(const String& t, const AccessibilityTextSource& s, const R efPtr<AXObject> element) 243 String m_text;
227 : text(t) 244 AccessibilityTextSource m_textSource;
228 , textSource(s) 245 RefPtr<AXObject> m_textElement;
229 , textElement(element)
230 { }
231 }; 246 };
232 247
233 enum AccessibilityOrientation { 248 enum AccessibilityOrientation {
234 AccessibilityOrientationUndefined = 0, 249 AccessibilityOrientationUndefined = 0,
235 AccessibilityOrientationVertical, 250 AccessibilityOrientationVertical,
236 AccessibilityOrientationHorizontal, 251 AccessibilityOrientationHorizontal,
237 }; 252 };
238 253
239 enum AXObjectInclusion { 254 enum AXObjectInclusion {
240 IncludeObject, 255 IncludeObject,
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 static bool includesARIAWidgetRole(const String&); 809 static bool includesARIAWidgetRole(const String&);
795 static bool hasInteractiveARIAAttribute(const Element&); 810 static bool hasInteractiveARIAAttribute(const Element&);
796 }; 811 };
797 812
798 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 813 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
799 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate) 814 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate)
800 815
801 } // namespace blink 816 } // namespace blink
802 817
803 #endif // AXObject_h 818 #endif // AXObject_h
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698