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

Unified Diff: ui/accessibility/ax_role_properties.cc

Issue 2969603002: Move two BrowserAccessibility role predicates to ax_role_properties. (Closed)
Patch Set: macos 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 0d7d03c65dc99b831ad29a05a6d8a32ce0b61fa4..bf66431a0f8705a5813f613e73534cf386cae643 100644
--- a/ui/accessibility/ax_role_properties.cc
+++ b/ui/accessibility/ax_role_properties.cc
@@ -84,4 +84,53 @@ bool IsRowContainer(ui::AXRole role) {
}
}
+bool IsControl(ui::AXRole role) {
+ switch (role) {
+ case ui::AX_ROLE_BUTTON:
+ case ui::AX_ROLE_CHECK_BOX:
+ case ui::AX_ROLE_COLOR_WELL:
+ case ui::AX_ROLE_COMBO_BOX:
+ case ui::AX_ROLE_DISCLOSURE_TRIANGLE:
+ case ui::AX_ROLE_LIST_BOX:
+ case ui::AX_ROLE_MENU:
+ case ui::AX_ROLE_MENU_BAR:
+ case ui::AX_ROLE_MENU_BUTTON:
+ case ui::AX_ROLE_MENU_ITEM:
+ case ui::AX_ROLE_MENU_ITEM_CHECK_BOX:
+ case ui::AX_ROLE_MENU_ITEM_RADIO:
+ case ui::AX_ROLE_MENU_LIST_OPTION:
+ case ui::AX_ROLE_MENU_LIST_POPUP:
+ case ui::AX_ROLE_POP_UP_BUTTON:
+ case ui::AX_ROLE_RADIO_BUTTON:
+ case ui::AX_ROLE_SCROLL_BAR:
+ case ui::AX_ROLE_SEARCH_BOX:
+ case ui::AX_ROLE_SLIDER:
+ case ui::AX_ROLE_SPIN_BUTTON:
+ case ui::AX_ROLE_SWITCH:
+ case ui::AX_ROLE_TAB:
+ case ui::AX_ROLE_TEXT_FIELD:
+ case ui::AX_ROLE_TOGGLE_BUTTON:
+ case ui::AX_ROLE_TREE:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool IsMenuRelated(ui::AXRole role) {
+ switch (role) {
+ case ui::AX_ROLE_MENU:
+ case ui::AX_ROLE_MENU_BAR:
+ case ui::AX_ROLE_MENU_BUTTON:
+ case ui::AX_ROLE_MENU_ITEM:
+ case ui::AX_ROLE_MENU_ITEM_CHECK_BOX:
+ case ui::AX_ROLE_MENU_ITEM_RADIO:
+ case ui::AX_ROLE_MENU_LIST_OPTION:
+ case ui::AX_ROLE_MENU_LIST_POPUP:
+ 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