summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 23:51:18 +0000
committerctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-29 23:51:18 +0000
commit2fdeee6b42824c2f53a3c815e98c2b3be9fdc2ea (patch)
treed707b3843a99cdc690f83635ea20192ac573eaf6 /chrome/browser/views
parent6adad206bfe6b833350eb0ec674f062070b1f6ae (diff)
downloadchromium_src-2fdeee6b42824c2f53a3c815e98c2b3be9fdc2ea.zip
chromium_src-2fdeee6b42824c2f53a3c815e98c2b3be9fdc2ea.tar.gz
chromium_src-2fdeee6b42824c2f53a3c815e98c2b3be9fdc2ea.tar.bz2
Allow the info bar close button to be focused by screen reader uses.
BUG=37360 TEST=Close button on infobar can be focused when using JAWS. Review URL: http://codereview.chromium.org/3577001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61011 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/infobars/infobars.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/chrome/browser/views/infobars/infobars.cc b/chrome/browser/views/infobars/infobars.cc
index 51e74e1b..c96f72f 100644
--- a/chrome/browser/views/infobars/infobars.cc
+++ b/chrome/browser/views/infobars/infobars.cc
@@ -150,12 +150,17 @@ void InfoBar::ViewHierarchyChanged(bool is_add, views::View* parent,
}
}
- // For accessibility, make the close button that the child view.
- if (parent == this && child != close_button_ &&
- HasChildView(close_button_) &&
- GetChildViewAt(GetChildViewCount() - 1) != close_button_) {
- RemoveChildView(close_button_);
- AddChildView(close_button_);
+ if (GetWidget() && GetWidget()->IsAccessibleWidget()) {
+ // For accessibility, make the close button the last child view.
+ if (parent == this && child != close_button_ &&
+ HasChildView(close_button_) &&
+ GetChildViewAt(GetChildViewCount() - 1) != close_button_) {
+ RemoveChildView(close_button_);
+ AddChildView(close_button_);
+ }
+
+ // Allow screen reader users to focus the close button.
+ close_button_->SetFocusable(true);
}
}