summaryrefslogtreecommitdiffstats
path: root/views/view.h
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-18 13:53:37 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-18 13:53:37 +0000
commit83548a4b7d23ca252944fa1dabfbe85bf5742157 (patch)
tree1c76116c200885db472e61b0778a8e22e0ca052c /views/view.h
parent7869f47d58149dc27a2e42de61d32f459c04d241 (diff)
downloadchromium_src-83548a4b7d23ca252944fa1dabfbe85bf5742157.zip
chromium_src-83548a4b7d23ca252944fa1dabfbe85bf5742157.tar.gz
chromium_src-83548a4b7d23ca252944fa1dabfbe85bf5742157.tar.bz2
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
Diffstat (limited to 'views/view.h')
-rw-r--r--views/view.h22
1 files changed, 22 insertions, 0 deletions
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;