summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 15:45:59 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 15:45:59 +0000
commit99313d7ef4b63556fdb0d8d429b2922f9068a33a (patch)
tree2fdc365760c240c112299e813930276268cc8b8c /views
parent872f67832ea7217ff40a943c8572c4661bedbee3 (diff)
downloadchromium_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')
-rw-r--r--views/accessibility/view_accessibility.cc4
-rw-r--r--views/controls/button/menu_button.cc7
-rw-r--r--views/controls/button/menu_button.h1
-rw-r--r--views/view.h11
4 files changed, 9 insertions, 14 deletions
diff --git a/views/accessibility/view_accessibility.cc b/views/accessibility/view_accessibility.cc
index 2dad53d..3613d99 100644
--- a/views/accessibility/view_accessibility.cc
+++ b/views/accessibility/view_accessibility.cc
@@ -710,10 +710,8 @@ void ViewAccessibility::SetState(VARIANT* msaa_state, views::View* view) {
// Check both for actual View focus, as well as accessibility focus.
views::View* parent = view->GetParent();
- if (view->HasFocus() ||
- (parent && parent->GetAccFocusedChildView() == view)) {
+ if (view->HasFocus())
msaa_state->lVal |= STATE_SYSTEM_FOCUSED;
- }
// Add on any view-specific states.
AccessibilityTypes::State state;
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);
diff --git a/views/view.h b/views/view.h
index 2b50f04..67cae75 100644
--- a/views/view.h
+++ b/views/view.h
@@ -608,17 +608,6 @@ class View : public AcceleratorTarget {
// re-used, otherwise a new instance will be created.
ViewAccessibilityWrapper* GetViewAccessibilityWrapper();
- // Accessor used to determine if a child view (leaf) has accessibility focus.
- // Returns NULL if there are no children, or if none of the children has
- // accessibility focus.
- virtual View* GetAccFocusedChildView() { return NULL; }
-
- // Try to give accessibility focus to a given child view. Returns true on
- // success. Returns false if this view isn't already focused, if it doesn't
- // support accessibility focus for children, or if the given view isn't a
- // valid child view that can receive accessibility focus.
- virtual bool SetAccFocusedChildView(View* child_view) { return false; }
-
// Utility functions
// Note that the utility coordinate conversions functions always operate on