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

Unified Diff: ui/accessibility/ax_role_properties.cc

Issue 2962453002: Move AX Role predicates into ax_role_properties.h. (Closed)
Patch Set: Android Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accessibility/ax_role_properties.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_role_properties.cc
diff --git a/ui/accessibility/ax_role_properties.cc b/ui/accessibility/ax_role_properties.cc
index aa712fab75c74cca9a6860cf1e87e7914645beb6..0d7d03c65dc99b831ad29a05a6d8a32ce0b61fa4 100644
--- a/ui/accessibility/ax_role_properties.cc
+++ b/ui/accessibility/ax_role_properties.cc
@@ -32,4 +32,56 @@ bool IsRoleClickable(AXRole role) {
}
}
+bool IsCellOrTableHeaderRole(ui::AXRole role) {
+ switch (role) {
+ case ui::AX_ROLE_CELL:
+ case ui::AX_ROLE_COLUMN_HEADER:
+ case ui::AX_ROLE_ROW_HEADER:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool IsTableLikeRole(ui::AXRole role) {
+ switch (role) {
+ case ui::AX_ROLE_TABLE:
+ case ui::AX_ROLE_GRID:
+ case ui::AX_ROLE_TREE_GRID:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool IsContainerWithSelectableChildrenRole(ui::AXRole role) {
+ switch (role) {
+ case ui::AX_ROLE_COMBO_BOX:
+ case ui::AX_ROLE_GRID:
+ case ui::AX_ROLE_LIST_BOX:
+ case ui::AX_ROLE_MENU:
+ case ui::AX_ROLE_MENU_BAR:
+ case ui::AX_ROLE_RADIO_GROUP:
+ case ui::AX_ROLE_TAB_LIST:
+ case ui::AX_ROLE_TOOLBAR:
+ case ui::AX_ROLE_TREE:
+ case ui::AX_ROLE_TREE_GRID:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool IsRowContainer(ui::AXRole role) {
+ switch (role) {
+ case ui::AX_ROLE_TREE:
+ case ui::AX_ROLE_TREE_GRID:
+ case ui::AX_ROLE_GRID:
+ case ui::AX_ROLE_TABLE:
+ return true;
+ default:
+ return false;
+ }
+}
+
} // namespace ui
« no previous file with comments | « ui/accessibility/ax_role_properties.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698