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

Unified Diff: ui/accessibility/ax_utils.cc

Issue 2671563002: MacViews: Implement NSAccessibilityPressAction for Views with clickable roles. (Closed)
Patch Set: Use method instead of private member. Created 3 years, 11 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: ui/accessibility/ax_utils.cc
diff --git a/ui/accessibility/ax_utils.cc b/ui/accessibility/ax_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1eea44b66e1c33cc8af9e8c466e09cf70f649f1b
--- /dev/null
+++ b/ui/accessibility/ax_utils.cc
@@ -0,0 +1,35 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/accessibility/ax_utils.h"
+
+namespace ui {
+
+bool IsRoleClickable(AXRole role) {
dmazzoni 2017/02/09 20:24:43 This is fine for now, but @aboxhall may have some
Patti Lor 2017/02/09 23:11:23 Oh, that sounds interesting, thanks for the FYI! I
+ switch (role) {
+ case ui::AX_ROLE_BUTTON:
tapted 2017/02/09 02:45:18 ui:: prefixes not needed
Patti Lor 2017/02/09 23:11:23 Oops, thanks!
+ case ui::AX_ROLE_CHECK_BOX:
+ case ui::AX_ROLE_COLOR_WELL:
+ case ui::AX_ROLE_DISCLOSURE_TRIANGLE:
+ case ui::AX_ROLE_IMAGE_MAP_LINK:
+ case ui::AX_ROLE_LINK:
+ case ui::AX_ROLE_LIST_BOX_OPTION:
+ 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_SWITCH:
+ case ui::AX_ROLE_TAB:
+ case ui::AX_ROLE_TOGGLE_BUTTON:
+ return true;
+ default:
+ return false;
+ }
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698