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

Side by Side Diff: Source/core/accessibility/AXListBoxOption.h

Issue 31463002: Introduce DEFINE_AX_OBJECT_TYPE_CASTS to replace manual toFoo() in accessibility child class (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/core/accessibility/AXImageMapLink.h ('k') | Source/core/accessibility/AXMenuList.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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 virtual bool isListBoxOption() const OVERRIDE { return true; } 69 virtual bool isListBoxOption() const OVERRIDE { return true; }
70 virtual bool canHaveChildren() const OVERRIDE { return false; } 70 virtual bool canHaveChildren() const OVERRIDE { return false; }
71 virtual bool computeAccessibilityIsIgnored() const OVERRIDE; 71 virtual bool computeAccessibilityIsIgnored() const OVERRIDE;
72 72
73 HTMLSelectElement* listBoxOptionParentNode() const; 73 HTMLSelectElement* listBoxOptionParentNode() const;
74 int listBoxOptionIndex() const; 74 int listBoxOptionIndex() const;
75 AXObject* listBoxOptionAXObject(HTMLElement*) const; 75 AXObject* listBoxOptionAXObject(HTMLElement*) const;
76 }; 76 };
77 77
78 inline AXListBoxOption* toAXListBoxOption(AXObject* object) 78 DEFINE_AX_OBJECT_TYPE_CASTS(AXListBoxOption, isListBoxOption());
r.kasibhatla 2013/10/21 12:28:31 Wouldn't it be better to construct even isFoo from
tkent 2013/10/21 22:06:11 We should go ahead with this CL as is, and discuss
79 {
80 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption());
81 return static_cast<AXListBoxOption*>(object);
82 }
83
84 inline const AXListBoxOption* toAXListBoxOption(const AXObject* object)
85 {
86 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption());
87 return static_cast<const AXListBoxOption*>(object);
88 }
89
90 // This will catch anyone doing an unnecessary cast.
91 void toAXListBoxOption(const AXListBoxOption*);
92 79
93 } // namespace WebCore 80 } // namespace WebCore
94 81
95 #endif // AXListBoxOption_h 82 #endif // AXListBoxOption_h
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXImageMapLink.h ('k') | Source/core/accessibility/AXMenuList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698