Index: ui/views/examples/button_example.cc |
diff --git a/ui/views/examples/button_example.cc b/ui/views/examples/button_example.cc |
index 02a56822c6540ef8340ffaa2d58d89608b55c496..00ca3fecd6b26699db3e5c253d479f13e1c9344e 100644 |
--- a/ui/views/examples/button_example.cc |
+++ b/ui/views/examples/button_example.cc |
@@ -44,7 +44,7 @@ void ButtonExample::CreateExampleView(View* container) { |
container->SetLayoutManager(layout); |
label_button_ = new LabelButton(this, ASCIIToUTF16(kLabelButton)); |
- label_button_->SetFocusable(true); |
+ label_button_->SetFocusBehavior(View::FocusBehavior::ALWAYS); |
container->AddChildView(label_button_); |
styled_button_ = new LabelButton(this, ASCIIToUTF16("Styled Button")); |
@@ -71,7 +71,7 @@ void ButtonExample::CreateExampleView(View* container) { |
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
image_button_ = new ImageButton(this); |
- image_button_->SetFocusable(true); |
+ image_button_->SetFocusBehavior(View::FocusBehavior::ALWAYS); |
image_button_->SetImage(ImageButton::STATE_NORMAL, |
rb.GetImageNamed(IDR_CLOSE).ToImageSkia()); |
image_button_->SetImage(ImageButton::STATE_HOVERED, |
@@ -103,7 +103,9 @@ void ButtonExample::LabelButtonPressed(LabelButton* label_button, |
} |
} else if (event.IsShiftDown()) { |
if (event.IsAltDown()) { |
- label_button->SetFocusable(!label_button->IsFocusable()); |
+ label_button->SetFocusBehavior(label_button->IsFocusable() |
+ ? View::FocusBehavior::NEVER |
+ : View::FocusBehavior::ALWAYS); |
} else { |
label_button->SetStyle(static_cast<Button::ButtonStyle>( |
(label_button->style() + 1) % Button::STYLE_COUNT)); |