Chromium Code Reviews| Index: ui/views/window/dialog_client_view.cc |
| diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc |
| index 5d543a7572efe2b85b8772f293c766cbdb19430f..c84d6a77b3ae3f8855f1a10c590eae20b36083fb 100644 |
| --- a/ui/views/window/dialog_client_view.cc |
| +++ b/ui/views/window/dialog_client_view.cc |
| @@ -319,6 +319,7 @@ void DialogClientView::SetupLayout() { |
| base::AutoReset<bool> auto_reset(&adding_or_removing_views_, true); |
| GridLayout* layout = new GridLayout(button_row_container_); |
| layout->set_minimum_size(minimum_size_); |
| + default_focus_ = GetDialogDelegate()->GetInitiallyFocusedView(); |
| // Clobber any existing LayoutManager since it has weak references to child |
| // Views which may be removed by SetupViews(). |
| @@ -399,6 +400,10 @@ void DialogClientView::SetupLayout() { |
| column_set->LinkColumnSizes(link[0], link[1], link[2], -1); |
| } |
| layout->AddPaddingRow(kFixed, insets.bottom()); |
| + |
| + if (default_focus_) { |
| + default_focus_->RequestFocus(); |
|
Devlin
2017/04/12 19:36:31
Maybe add a comment why we need to do this.
Ackerman
2017/04/28 18:22:59
Done.
|
| + } |
| } |
| void DialogClientView::SetupViews() { |