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

Unified Diff: ui/accessibility/platform/ax_platform_node_win.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/platform/ax_platform_node_auralinux.cc ('k') | ui/views/controls/button/checkbox.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_win.cc
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc
index 9a3619ed7ff31aaba10d3a29579dffd7efb776fc..42f246762d1d8435549896521a1b5323e09f6671 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -1053,11 +1053,10 @@ int AXPlatformNodeWin::MSAARole() {
}
int AXPlatformNodeWin::MSAAState() {
- uint32_t state = GetData().state;
+ const AXNodeData& data = GetData();
+ const uint32_t state = data.state;
int msaa_state = 0;
- if (state & (1 << ui::AX_STATE_CHECKED))
- msaa_state |= STATE_SYSTEM_CHECKED;
if (state & (1 << ui::AX_STATE_COLLAPSED))
msaa_state |= STATE_SYSTEM_COLLAPSED;
if (state & (1 << ui::AX_STATE_DEFAULT))
@@ -1089,6 +1088,20 @@ int AXPlatformNodeWin::MSAAState() {
if (state & (1 << ui::AX_STATE_DISABLED))
msaa_state |= STATE_SYSTEM_UNAVAILABLE;
+ // Checked state
+ const auto checked_state = static_cast<ui::AXCheckedState>(
+ GetIntAttribute(ui::AX_ATTR_CHECKED_STATE));
+ switch (checked_state) {
+ case ui::AX_CHECKED_STATE_TRUE:
+ msaa_state |= STATE_SYSTEM_CHECKED;
+ break;
+ case ui::AX_CHECKED_STATE_MIXED:
+ msaa_state |= STATE_SYSTEM_MIXED;
+ break;
+ default:
+ break;
+ }
+
gfx::NativeViewAccessible focus = delegate_->GetFocus();
if (focus == GetNativeViewAccessible())
msaa_state |= STATE_SYSTEM_FOCUSED;
@@ -1099,7 +1112,7 @@ int AXPlatformNodeWin::MSAAState() {
// TODO(dmazzoni): this should probably check if focus is actually inside
// the menu bar, but we don't currently track focus inside menu pop-ups,
// and Chrome only has one menu visible at a time so this works for now.
- if (GetData().role == ui::AX_ROLE_MENU_BAR &&
+ if (data.role == ui::AX_ROLE_MENU_BAR &&
!(state & (1 << ui::AX_STATE_INVISIBLE))) {
msaa_state |= STATE_SYSTEM_FOCUSED;
}
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_auralinux.cc ('k') | ui/views/controls/button/checkbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698