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

Unified Diff: Source/core/accessibility/AccessibilityListBoxOption.h

Issue 24752002: Cleanup <static_cast>: Switch to toFoo for Accessibility Objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/accessibility/AccessibilityListBoxOption.h
diff --git a/Source/core/accessibility/AccessibilityListBoxOption.h b/Source/core/accessibility/AccessibilityListBoxOption.h
index 987b5bc7754e8fa5279bce11abb6c1e6f1762a6e..364273dc830d6091318ba06c361103a99b21dc58 100644
--- a/Source/core/accessibility/AccessibilityListBoxOption.h
+++ b/Source/core/accessibility/AccessibilityListBoxOption.h
@@ -66,6 +66,7 @@ public:
private:
HTMLElement* m_optionElement;
+ virtual bool isListBoxOption() const OVERRIDE { return true; }
virtual bool canHaveChildren() const OVERRIDE { return false; }
virtual bool computeAccessibilityIsIgnored() const OVERRIDE;
@@ -74,6 +75,21 @@ private:
AccessibilityObject* listBoxOptionAccessibilityObject(HTMLElement*) const;
};
+inline AccessibilityListBoxOption* toAccessibilityListBoxOption(AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption());
+ return static_cast<AccessibilityListBoxOption*>(object);
+}
+
+inline const AccessibilityListBoxOption* toAccessibilityListBoxOption(const AccessibilityObject* object)
+{
+ ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isListBoxOption());
+ return static_cast<const AccessibilityListBoxOption*>(object);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toAccessibilityListBoxOption(const AccessibilityListBoxOption*);
+
} // namespace WebCore
#endif // AccessibilityListBoxOption_h
« no previous file with comments | « Source/core/accessibility/AccessibilityListBox.cpp ('k') | Source/core/accessibility/AccessibilityMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698