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

Unified Diff: ui/accessibility/platform/ax_platform_node_auralinux.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: git cl try Created 3 years, 8 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_tree_unittest.cc ('k') | ui/accessibility/platform/ax_platform_node_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/platform/ax_platform_node_auralinux.cc
diff --git a/ui/accessibility/platform/ax_platform_node_auralinux.cc b/ui/accessibility/platform/ax_platform_node_auralinux.cc
index 11bdcde2e4dbdb92e596fd5e48ac870effc94fc4..4a85863c714950168cafb0947003eb0e01c00112 100644
--- a/ui/accessibility/platform/ax_platform_node_auralinux.cc
+++ b/ui/accessibility/platform/ax_platform_node_auralinux.cc
@@ -461,10 +461,8 @@ AtkRole AXPlatformNodeAuraLinux::GetAtkRole() {
}
void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* atk_state_set) {
- uint32_t state = GetData().state;
+ const uint32_t state = GetData().state;
- if (state & (1 << ui::AX_STATE_CHECKED))
- atk_state_set_add_state(atk_state_set, ATK_STATE_CHECKED);
if (state & (1 << ui::AX_STATE_DEFAULT))
atk_state_set_add_state(atk_state_set, ATK_STATE_DEFAULT);
if (state & (1 << ui::AX_STATE_EDITABLE))
@@ -482,6 +480,20 @@ void AXPlatformNodeAuraLinux::GetAtkState(AtkStateSet* atk_state_set) {
if (state & (1 << ui::AX_STATE_SELECTED))
atk_state_set_add_state(atk_state_set, ATK_STATE_SELECTED);
+ // Checked state
+ const auto checked_state = static_cast<ui::AXCheckedState>(
+ GetIntAttribute(ui::AX_ATTR_CHECKED_STATE));
+ switch (checked_state) {
+ case ui::AX_CHECKED_STATE_MIXED:
+ atk_state_set_add_state(atk_state_set, ATK_STATE_INDETERMINATE);
+ break;
+ case ui::AX_CHECKED_STATE_TRUE:
+ atk_state_set_add_state(atk_state_set, ATK_STATE_CHECKED);
+ break;
+ default:
+ break;
+ }
+
if (delegate_->GetFocus() == GetNativeViewAccessible())
atk_state_set_add_state(atk_state_set, ATK_STATE_FOCUSED);
}
« no previous file with comments | « ui/accessibility/ax_tree_unittest.cc ('k') | ui/accessibility/platform/ax_platform_node_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698