diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-22 15:45:59 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-22 15:45:59 +0000 |
commit | 99313d7ef4b63556fdb0d8d429b2922f9068a33a (patch) | |
tree | 2fdc365760c240c112299e813930276268cc8b8c /views/controls | |
parent | 872f67832ea7217ff40a943c8572c4661bedbee3 (diff) | |
download | chromium_src-99313d7ef4b63556fdb0d8d429b2922f9068a33a.zip chromium_src-99313d7ef4b63556fdb0d8d429b2922f9068a33a.tar.gz chromium_src-99313d7ef4b63556fdb0d8d429b2922f9068a33a.tar.bz2 |
Small tweaks to improve toolbar keyboard accessibility: Put focus rects
around more controls (including location bar, only when in full keyboard
access mode). Fix accessible names. Fix spacebar to activate menu buttons.
Remove methods for child focus, they're not needed anymore.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2817022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/button/menu_button.cc | 7 | ||||
-rw-r--r-- | views/controls/button/menu_button.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc index 3af0326..2a63124 100644 --- a/views/controls/button/menu_button.cc +++ b/views/controls/button/menu_button.cc @@ -226,6 +226,13 @@ bool MenuButton::OnKeyPressed(const KeyEvent& e) { return false; } +bool MenuButton::OnKeyReleased(const KeyEvent& e) { + // Override CustomButton's implementation, which presses the button when + // you press space and clicks it when you release space. For a MenuButton + // we always activate the menu on key press. + return false; +} + // The reason we override View::OnMouseExited is because we get this event when // we display the menu. If we don't override this method then // BaseButton::OnMouseExited will get the event and will set the button's state diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h index 1e20250..2876078 100644 --- a/views/controls/button/menu_button.h +++ b/views/controls/button/menu_button.h @@ -59,6 +59,7 @@ class MenuButton : public TextButton { virtual void OnMouseReleased(const MouseEvent& e, bool canceled); virtual void OnMouseExited(const MouseEvent& event); virtual bool OnKeyPressed(const KeyEvent& e); + virtual bool OnKeyReleased(const KeyEvent& e); // Accessibility accessors, overridden from View. virtual bool GetAccessibleDefaultAction(std::wstring* action); |