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) { |