Chromium Code Reviews| Index: ui/views/view.cc |
| diff --git a/ui/views/view.cc b/ui/views/view.cc |
| index 4c62a000f61882cf5115a2f541ba8e7b86fb8af5..7e8bdd88edc87ee200e495e519eaec0694bf9d6e 100644 |
| --- a/ui/views/view.cc |
| +++ b/ui/views/view.cc |
| @@ -1201,6 +1201,32 @@ void View::SetNextFocusableView(View* view) { |
| next_focusable_view_ = view; |
| } |
| +void View::SetFocusBehavior(FocusBehavior focus_behavior) { |
| + switch (focus_behavior) { |
| + case ALWAYS: |
| + SetFocusable(true); |
| + SetAccessibilityFocusable(true); |
| + break; |
| + case NEVER: |
| + SetFocusable(false); |
| + SetAccessibilityFocusable(false); |
| + break; |
| + case ACCESSIBLE_ONLY: |
| + SetFocusable(false); |
| + SetAccessibilityFocusable(true); |
| + break; |
| + case CONTROL: |
| +#if defined(OS_MACOSX) |
|
tapted
2016/03/15 05:05:32
This might be more readable with something like (a
karandeepb
2016/03/17 07:24:47
Done.
|
| + SetFocusable(false); |
| + SetAccessibilityFocusable(true); |
| +#else |
| + SetFocusable(true); |
| + SetAccessibilityFocusable(true); |
| +#endif |
| + break; |
| + } |
| +} |
| + |
| void View::SetFocusable(bool focusable) { |
| if (focusable_ == focusable) |
| return; |