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

Unified Diff: chrome/browser/views/infobars/infobars.cc

Issue 3421033: Send an EVENT_SYSTEM_ALERT when a user first places focus within an infobar. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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/views/infobars/infobars.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/infobars/infobars.cc
===================================================================
--- chrome/browser/views/infobars/infobars.cc (revision 60474)
+++ chrome/browser/views/infobars/infobars.cc (working copy)
@@ -185,6 +185,15 @@
}
}
+// InfoBar, views::FocusChangeListener implementation: ------------------
+
+void InfoBar::FocusWillChange(View* focused_before, View* focused_now) {
+ if (focused_before && focused_now &&
+ !this->IsParentOf(focused_before) && this->IsParentOf(focused_now)) {
+ NotifyAccessibilityEvent(AccessibilityTypes::EVENT_ALERT);
+ }
+}
+
// InfoBar, AnimationDelegate implementation: ----------------------------------
void InfoBar::AnimationProgressed(const Animation* animation) {
@@ -254,6 +263,9 @@
}
#endif
+ if (GetFocusManager())
+ GetFocusManager()->AddFocusChangeListener(this);
+
NotifyAccessibilityEvent(AccessibilityTypes::EVENT_ALERT);
}
@@ -267,6 +279,9 @@
// since no-one refers to us now.
MessageLoop::current()->PostTask(FROM_HERE,
delete_factory_.NewRunnableMethod(&InfoBar::DeleteSelf));
+
+ if (GetFocusManager())
+ GetFocusManager()->RemoveFocusChangeListener(this);
}
void InfoBar::DestroyFocusTracker(bool restore_focus) {
« no previous file with comments | « chrome/browser/views/infobars/infobars.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698