Index: ui/views/view.h |
diff --git a/ui/views/view.h b/ui/views/view.h |
index 897160ea199e36d922f15edd57ae0e1e646e3653..7376fc81be06419f9a90f8b269f50d1210913952 100644 |
--- a/ui/views/view.h |
+++ b/ui/views/view.h |
@@ -115,6 +115,22 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, |
public: |
typedef std::vector<View*> Views; |
+ enum class FocusBehavior { |
+ // Use when the view is to be focusable both in default and full keyboard |
+ // access mode. |
+ ALWAYS, |
+ |
+ // Use when view is never focusable. Default. |
+ NEVER, |
+ |
+ // Use when the view is to be made focusable only during full keyboard mode. |
+ ACCESSIBLE_ONLY, |
+ |
+ // Use for controls. On Mac, this is the same as ACCESSIBLE_ONLY mode, while |
+ // on other platforms it corresponds to ALWAYS. |
+ CONTROL, |
sky
2016/04/12 16:39:52
CONTROL sounds good, but in practice it is really
|
+ }; |
+ |
struct ViewHierarchyChangedDetails { |
ViewHierarchyChangedDetails() |
: is_add(false), |
@@ -768,10 +784,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 +806,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 |