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

Side by Side Diff: Source/core/accessibility/AXTableColumn.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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 private: 59 private:
60 unsigned m_columnIndex; 60 unsigned m_columnIndex;
61 LayoutRect m_columnRect; 61 LayoutRect m_columnRect;
62 62
63 virtual bool isTableCol() const OVERRIDE { return true; } 63 virtual bool isTableCol() const OVERRIDE { return true; }
64 AXObject* headerObjectForSection(RenderTableSection*, bool thTagRequired); 64 AXObject* headerObjectForSection(RenderTableSection*, bool thTagRequired);
65 virtual bool computeAccessibilityIsIgnored() const OVERRIDE; 65 virtual bool computeAccessibilityIsIgnored() const OVERRIDE;
66 }; 66 };
67 67
68 inline AXTableColumn* toAXTableColumn(AXObject* object) 68 DEFINE_AX_OBJECT_TYPE_CASTS(AXTableColumn, isTableCol());
69 {
70 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTableCol());
71 return static_cast<AXTableColumn*>(object);
72 }
73
74 inline const AXTableColumn* toAXTableColumn(const AXObject* object)
75 {
76 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTableCol());
77 return static_cast<const AXTableColumn*>(object);
78 }
79
80 // This will catch anyone doing an unnecessary cast.
81 void toAXTableColumn(const AXTableColumn*);
82 69
83 } // namespace WebCore 70 } // namespace WebCore
84 71
85 #endif // AXTableColumn_h 72 #endif // AXTableColumn_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698