Chromium Code Reviews| Index: chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc |
| diff --git a/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc |
| index 4afc4e3268e07a1232859e3bbe6b5c78b49b381e..a91d3f73de8d9e062923219aab7d21e32ecacfc1 100644 |
| --- a/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc |
| +++ b/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc |
| @@ -26,7 +26,7 @@ |
| using views::FocusManager; |
| AccessibilityEventRouterViews::AccessibilityEventRouterViews() |
| - : most_recent_profile_(NULL) { |
| + : most_recent_profile_(NULL), most_recent_view_(NULL) { |
|
Daniel Erat
2014/07/09 23:10:24
nit: one per line if they don't all fit on the sam
evy
2014/07/10 17:19:57
Done.
|
| // Register for notification when profile is destroyed to ensure that all |
| // observers are detatched at that time. |
| registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
| @@ -163,6 +163,29 @@ void AccessibilityEventRouterViews::DispatchAccessibilityEvent( |
| return; |
| } |
| + // The highest focusable view is processed to handle cases where there are |
| + // focusable views inside other focusable views (e.g. hover for date text |
| + // on the status bar) and the status bar information should be read instead |
| + // of the specific button inside. |
| + views::View* highest_focusable_view = view; |
| + while (view->parent()) { |
| + view = view->parent(); |
| + if (view->IsFocusable()) { |
| + highest_focusable_view = view; |
| + } |
| + } |
| + view = highest_focusable_view; |
| + |
| + // Since multiple items could share a highest focusable view, these items |
| + // could all dispatch the same accessibility hover events, which isn't |
| + // necessary. |
| + if (type == ui::AX_EVENT_HOVER && |
| + most_recent_view_ && |
|
Peter Lundblad
2014/07/09 23:08:11
view must be non-null here, so this check is redun
Daniel Erat
2014/07/09 23:10:24
nit: fix indenting
also, view seems to be non-NUL
evy
2014/07/10 17:19:57
Done.
evy
2014/07/10 17:19:57
Done.
|
| + most_recent_view_ == view) { |
| + return; |
| + } |
| + most_recent_view_ = view; |
| + |
| ui::AXViewState state; |
| view->GetAccessibleState(&state); |