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

Unified Diff: chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc

Issue 380943002: Added battery level and time to the status tray's accessible name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « chrome/browser/ui/views/accessibility/accessibility_event_router_views.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..88e2b99836eb235937cab578e4cf0108a1a4b2ef 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
sky 2014/07/11 15:44:02 It's not clear to me why you want the highest focu
dmazzoni 2014/07/11 16:11:38 If a view is focusable, it's usually atomic wrt ac
sky 2014/07/11 19:06:08 What mechanism does the status tray button use to
evy 2014/07/12 00:32:50 Aha. If I go to the next highest accessibility foc
+ // views inside other focusable views (e.g. hover for date text on the
+ // status bar) and the status bar information should be read instead
sky 2014/07/11 15:44:02 nit: you've got an extra space at the beginning.
evy 2014/07/11 18:15:10 Done.
+ // of the specific button inside. Here |view| is updated its highest
+ // focusable ancestor.
+ views::View* temp_view = view;
+ while (temp_view->parent()) {
+ temp_view = temp_view->parent();
+ if (temp_view->IsFocusable()) {
dmazzoni 2014/07/10 23:25:58 Nit: in C++, braces aren't needed when the "if" co
evy 2014/07/11 18:15:10 Done.
+ view = temp_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;
sky 2014/07/11 15:44:02 I don't see this ever set to NULL. What if most_re
dmazzoni 2014/07/11 16:11:38 It should be harmless because all we ever do is te
sky 2014/07/11 19:06:08 Two concerns: there is nothing stopping the pointe
evy 2014/07/12 00:32:50 Done.
+
ui::AXViewState state;
view->GetAccessibleState(&state);
« no previous file with comments | « chrome/browser/ui/views/accessibility/accessibility_event_router_views.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698