Index: ui/views/focus/focus_manager.h |
diff --git a/ui/views/focus/focus_manager.h b/ui/views/focus/focus_manager.h |
index debdbe98fff1154e3c3933b9d370ab1dc9462a04..d2595f6b71426f49af4a26a71aa7bb717af36224 100644 |
--- a/ui/views/focus/focus_manager.h |
+++ b/ui/views/focus/focus_manager.h |
@@ -201,7 +201,8 @@ class VIEWS_EXPORT FocusManager { |
// Restore the view saved with a previous call to StoreFocusedView(). Used |
// when the widget becomes active. Returns true when the previous view was |
- // successfully refocused - otherwise false. |
+ // successfully refocused. In case the stored view is no longer focusable, |
+ // it advances focus and returns false. |
bool RestoreFocusedView(); |
// Sets the |view| to be restored when calling RestoreFocusView. This is used |
@@ -319,6 +320,12 @@ class VIEWS_EXPORT FocusManager { |
bool reverse, |
bool dont_loop); |
+ bool keyboard_accessible() const { return keyboard_accessible_; } |
+ |
+ // Updates |keyboard_accessible_| to the given value and advances focus if |
+ // necessary. |
+ void SetKeyboardAccessible(bool keyboard_accessible); |
+ |
private: |
// Returns the focusable view found in the FocusTraversable specified starting |
// at the specified view. This traverses down along the FocusTraversable |
@@ -332,6 +339,10 @@ class VIEWS_EXPORT FocusManager { |
// and should not be processed further. |
bool ProcessArrowKeyTraversal(const ui::KeyEvent& event); |
+ // Returns true if the |view| is accessibility focusable (checking |
+ // IsFocusable() if |keyboard_accessible_| is false on Mac). |
tapted
2016/05/03 08:08:25
nit: (this reads a bit funny). Maybe
// Whether |
karandeepb
2016/05/04 01:56:38
Done.
|
+ bool IsFocusable(View* view) const; |
+ |
// Whether arrow key traversal is enabled. |
static bool arrow_key_traversal_enabled_; |
@@ -364,6 +375,15 @@ class VIEWS_EXPORT FocusManager { |
// See description above getter. |
bool is_changing_focus_; |
+ // This is true if full keyboard accessibility is needed. This causes |
+ // IsAccessibilityFocusable() to be checked rather than IsFocusable(). This |
+ // can be set depending on platform constraints. FocusSearch uses this in |
+ // addition to its own accessibility mode, which handles accessibility at the |
+ // FocusTraversable level. Currently only used on Mac, when Full Keyboard |
+ // access is enabled. |
+ // Default value is false. |
+ bool keyboard_accessible_; |
+ |
DISALLOW_COPY_AND_ASSIGN(FocusManager); |
}; |