Views: Add new SetFocusBehavior method.
This CL adds a new SetFocusBehavior method to View class which takes a
FocusBehavior enum, replacing the existing SetFocusable and
SetAccessibilityFocusable methods.
Motivation for this change:
- SetFocusBehavior helps describe the focus behavior of a view
completely and concisely. This is especially convenient considering the
changes crrev.com/1894383002/ will bring.
- It helps avoid a meaningless state where focusable_ is true and
accessibility_focusable_ is false for a view.
This is first in part of the CLs to implement Full Keyboard Access on MacViews.
For prior discussion related to this CL, see crrev.com/1690543004.
BUG=564912
Review-Url: https://codereview.chromium.org/1898633004
Cr-Commit-Position: refs/heads/master@{#390244}
diff --git a/ash/focus_cycler_unittest.cc b/ash/focus_cycler_unittest.cc
index e13973e..b9842e5 100644
--- a/ash/focus_cycler_unittest.cc
+++ b/ash/focus_cycler_unittest.cc
@@ -318,22 +318,22 @@
root_view->AddChildView(pane1);
views::View* view1 = new views::View;
- view1->SetFocusable(true);
+ view1->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
pane1->AddChildView(view1);
views::View* view2 = new views::View;
- view2->SetFocusable(true);
+ view2->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
pane1->AddChildView(view2);
views::AccessiblePaneView* pane2 = new views::AccessiblePaneView();
root_view->AddChildView(pane2);
views::View* view3 = new views::View;
- view3->SetFocusable(true);
+ view3->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
pane2->AddChildView(view3);
views::View* view4 = new views::View;
- view4->SetFocusable(true);
+ view4->SetFocusBehavior(views::View::FocusBehavior::ALWAYS);
pane2->AddChildView(view4);
std::vector<views::View*> panes;