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

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

Issue 1801183002: Fix accessible focus state on menu bar container. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 95632d8e558266b1f6f1fabd15aed766e36c753c..4cb9ef1b623792532608bb526af3829eef1adc7a 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -1026,9 +1026,15 @@ int AXPlatformNodeWin::MSAAState() {
msaa_state |= STATE_SYSTEM_FOCUSED;
// On Windows, the "focus" bit should be set on certain containers, like
- // menu bars, when one of their children has focus.
- if (GetData().role == ui::AX_ROLE_MENU_BAR && focus)
+ // menu bars, when visible.
+ //
+ // 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 &&
+ !(state & (1 << ui::AX_STATE_INVISIBLE))) {
msaa_state |= STATE_SYSTEM_FOCUSED;
+ }
return msaa_state;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698