Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: ui/views/view.h

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing tests. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/focus/focus_traversal_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/views/focus/focus_traversal_unittest.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698