From 83548a4b7d23ca252944fa1dabfbe85bf5742157 Mon Sep 17 00:00:00 2001 From: "dmazzoni@chromium.org" Date: Fri, 18 Jun 2010 13:53:37 +0000 Subject: Improve toolbar keyboard accessibility. Design doc: https://docs.google.com/a/google.com/Doc?docid=0ATICCjR-gNReY2djdjkyNnNfNzl4ZnpiODQ2Mg&hl=en BUG=40745 BUG=36728 BUG=36222 TEST=New test added to focus_manager_unittest.cc Review URL: http://codereview.chromium.org/2737010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50234 0039d316-1c4b-4281-b951-d872f2087c98 --- views/view.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'views/view.h') diff --git a/views/view.h b/views/view.h index a9012a5..f6d1efa 100644 --- a/views/view.h +++ b/views/view.h @@ -514,6 +514,17 @@ class View : public AcceleratorTarget { // not get the focus. virtual void SetFocusable(bool focusable); + // Return whether this view is focusable when the user requires + // full keyboard access, even though it may not be normally focusable. + virtual bool IsAccessibilityFocusable() const; + + // Set whether this view can be made focusable if the user requires + // full keyboard access, even though it's not normally focusable. + // Note that this is false by default. + virtual void set_accessibility_focusable(bool accessibility_focusable) { + accessibility_focusable_ = accessibility_focusable; + } + // Convenience method to retrieve the FocusManager associated with the // Widget that contains this view. This can return NULL if this view is not // part of a view hierarchy with a Widget. @@ -931,6 +942,13 @@ class View : public AcceleratorTarget { // FocusTraversable for the focus traversal to work properly. virtual FocusTraversable* GetFocusTraversable() { return NULL; } + // Subclasses that can act as a "pane" must implement their own + // FocusTraversable to keep the focus trapped within the pane. + // If this method returns an object, any view that's a direct or + // indirect child of this view will always use this FocusTraversable + // rather than the one from the widget. + virtual FocusTraversable* GetPaneFocusTraversable() { return NULL; } + #ifndef NDEBUG // Debug method that logs the view hierarchy to the output. void PrintViewHierarchy(); @@ -1101,6 +1119,10 @@ class View : public AcceleratorTarget { // Whether the view can be focused. bool focusable_; + // Whether this view is focusable if the user requires full keyboard access, + // even though it may not be normally focusable. + bool accessibility_focusable_; + private: friend class RootView; friend class FocusManager; -- cgit v1.1