Index: ui/views/view.h |
diff --git a/ui/views/view.h b/ui/views/view.h |
index 897160ea199e36d922f15edd57ae0e1e646e3653..ee4ced225e7e908d8ae9bdd4a7e5be6614a8ea36 100644 |
--- a/ui/views/view.h |
+++ b/ui/views/view.h |
@@ -751,6 +751,16 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
// Focus --------------------------------------------------------------------- |
+ enum FocusBehavior { |
tapted
2016/03/15 05:05:32
enums are always declared before methods in the cl
karandeepb
2016/03/17 07:24:47
Done.
|
+ ALWAYS, // Use when the view is to be focusable both in default and full |
tapted
2016/03/15 05:05:32
nit: if we can't fit in a line, we usually just co
karandeepb
2016/03/17 07:24:47
Done.
|
+ // keyboard access mode. |
+ NEVER, // Default. |
+ ACCESSIBLE_ONLY, // Use when the view is to be made focusable only during |
+ // full keyboard mode. |
+ CONTROL // Use for controls. On Mac, this is the same as ACCESSIBLE_ONLY |
tapted
2016/03/15 05:05:32
nit: CONTROL,
karandeepb
2016/03/17 07:24:47
Done.
|
+ // mode, while on other platforms it corresponds to ALWAYS. |
+ }; |
+ |
// Returns whether this view currently has the focus. |
virtual bool HasFocus() const; |
@@ -768,10 +778,15 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
// IMPORTANT NOTE: loops in the focus hierarchy are not supported. |
void SetNextFocusableView(View* view); |
+ // Sets |focusable_| and |accessibility_focusable_| corresponding to the given |
+ // |focus_behavior|. |
+ void SetFocusBehavior(FocusBehavior focus_behavior); |
+ |
// Sets whether this view is capable of taking focus. It will clear focus if |
// the focused view is set to be non-focusable. |
// Note that this is false by default so that a view used as a container does |
// not get the focus. |
+ // TODO(karandeepb): Make private. |
void SetFocusable(bool focusable); |
// Returns true if this view is |focusable_|, |enabled_| and drawn. |
@@ -785,6 +800,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
// full keyboard access, even though it's not normally focusable. It will |
// clear focus if the focused view is set to be non-focusable. |
// Note that this is false by default. |
+ // TODO(karandeepb): Make private. |
void SetAccessibilityFocusable(bool accessibility_focusable); |
// Convenience method to retrieve the FocusManager associated with the |