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

Side by Side 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, 5 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
« no previous file with comments | « ui/accessibility/ax_role_properties.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/accessibility/ax_role_properties.h" 5 #include "ui/accessibility/ax_role_properties.h"
6 6
7 namespace ui { 7 namespace ui {
8 8
9 bool IsRoleClickable(AXRole role) { 9 bool IsRoleClickable(AXRole role) {
10 switch (role) { 10 switch (role) {
(...skipping 14 matching lines...) Expand all
25 case AX_ROLE_RADIO_BUTTON: 25 case AX_ROLE_RADIO_BUTTON:
26 case AX_ROLE_SWITCH: 26 case AX_ROLE_SWITCH:
27 case AX_ROLE_TAB: 27 case AX_ROLE_TAB:
28 case AX_ROLE_TOGGLE_BUTTON: 28 case AX_ROLE_TOGGLE_BUTTON:
29 return true; 29 return true;
30 default: 30 default:
31 return false; 31 return false;
32 } 32 }
33 } 33 }
34 34
35 bool IsCellOrTableHeaderRole(ui::AXRole role) {
36 switch (role) {
37 case ui::AX_ROLE_CELL:
38 case ui::AX_ROLE_COLUMN_HEADER:
39 case ui::AX_ROLE_ROW_HEADER:
40 return true;
41 default:
42 return false;
43 }
44 }
45
46 bool IsTableLikeRole(ui::AXRole role) {
47 switch (role) {
48 case ui::AX_ROLE_TABLE:
49 case ui::AX_ROLE_GRID:
50 case ui::AX_ROLE_TREE_GRID:
51 return true;
52 default:
53 return false;
54 }
55 }
56
57 bool IsContainerWithSelectableChildrenRole(ui::AXRole role) {
58 switch (role) {
59 case ui::AX_ROLE_COMBO_BOX:
60 case ui::AX_ROLE_GRID:
61 case ui::AX_ROLE_LIST_BOX:
62 case ui::AX_ROLE_MENU:
63 case ui::AX_ROLE_MENU_BAR:
64 case ui::AX_ROLE_RADIO_GROUP:
65 case ui::AX_ROLE_TAB_LIST:
66 case ui::AX_ROLE_TOOLBAR:
67 case ui::AX_ROLE_TREE:
68 case ui::AX_ROLE_TREE_GRID:
69 return true;
70 default:
71 return false;
72 }
73 }
74
75 bool IsRowContainer(ui::AXRole role) {
76 switch (role) {
77 case ui::AX_ROLE_TREE:
78 case ui::AX_ROLE_TREE_GRID:
79 case ui::AX_ROLE_GRID:
80 case ui::AX_ROLE_TABLE:
81 return true;
82 default:
83 return false;
84 }
85 }
86
35 } // namespace ui 87 } // namespace ui
OLDNEW
« 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