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..222a8b5d5a36841d4951067936047d05cfc70192 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,8 @@ |
using views::FocusManager; |
AccessibilityEventRouterViews::AccessibilityEventRouterViews() |
- : most_recent_profile_(NULL) { |
+ : most_recent_profile_(NULL), |
+ most_recent_view_(NULL) { |
// 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 +164,26 @@ 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 |
dmazzoni
2014/07/10 17:28:21
Actually this handles *any* views inside focusable
evy
2014/07/10 18:57:40
Done.
|
+ // 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()) { |
dmazzoni
2014/07/10 17:28:21
It seems a little confusing to have "view" walk up
evy
2014/07/10 18:57:40
Done.
|
+ 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_ == view) |
+ return; |
+ most_recent_view_ = view; |
+ |
ui::AXViewState state; |
view->GetAccessibleState(&state); |