diff options
Diffstat (limited to 'chromium/ui/views/window/dialog_delegate.cc')
-rw-r--r-- | chromium/ui/views/window/dialog_delegate.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chromium/ui/views/window/dialog_delegate.cc b/chromium/ui/views/window/dialog_delegate.cc index 6afc661f5a2..21fea394e44 100644 --- a/chromium/ui/views/window/dialog_delegate.cc +++ b/chromium/ui/views/window/dialog_delegate.cc @@ -162,6 +162,9 @@ void DialogDelegate::RunCloseCallback(base::OnceClosure callback) { } View* DialogDelegate::GetInitiallyFocusedView() { + if (params_.initially_focused_view.has_value()) + return *params_.initially_focused_view; + // Focus the default button if any. const DialogClientView* dcv = GetDialogClientView(); if (!dcv) @@ -370,6 +373,10 @@ void DialogDelegate::SetCloseCallback(base::OnceClosure callback) { close_callback_ = std::move(callback); } +void DialogDelegate::SetInitiallyFocusedView(View* view) { + params_.initially_focused_view = view; +} + std::unique_ptr<View> DialogDelegate::DisownExtraView() { return std::move(extra_view_); } |