summaryrefslogtreecommitdiff
path: root/chromium/ui/views/window/dialog_delegate.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/ui/views/window/dialog_delegate.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ui/views/window/dialog_delegate.h')
-rw-r--r--chromium/ui/views/window/dialog_delegate.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/chromium/ui/views/window/dialog_delegate.h b/chromium/ui/views/window/dialog_delegate.h
index 04bc5b4cdce..2b35fd9e2c2 100644
--- a/chromium/ui/views/window/dialog_delegate.h
+++ b/chromium/ui/views/window/dialog_delegate.h
@@ -64,6 +64,11 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
// dialog. It's legal for a button to be marked enabled that isn't present
// in |buttons| (see above).
int enabled_buttons = ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL;
+
+ // The view that should receive initial focus in the dialog. If not set, the
+ // default button will receive initial focus. If explicitly set to nullptr,
+ // no view will receive focus.
+ base::Optional<View*> initially_focused_view;
};
DialogDelegate();
@@ -192,8 +197,23 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
void SetButtons(int buttons);
void SetButtonLabel(ui::DialogButton button, base::string16 label);
void SetButtonEnabled(ui::DialogButton button, bool enabled);
+ void SetInitiallyFocusedView(View* view);
+
+ // Called when the user presses the dialog's "OK" button or presses the dialog
+ // accept accelerator, if there is one.
void SetAcceptCallback(base::OnceClosure callback);
+
+ // Called when the user presses the dialog's "Cancel" button or presses the
+ // dialog close accelerator (which is always VKEY_ESCAPE).
void SetCancelCallback(base::OnceClosure callback);
+
+ // Called when:
+ // * The user presses the dialog's close button, if it has one
+ // * The dialog's widget is closed via Widget::Close()
+ // NOT called when the dialog's widget is closed via Widget::CloseNow() - in
+ // that case, the normal widget close path is skipped, so no orderly teardown
+ // of the dialog's widget happens. The main way that can happen in production
+ // use is if the dialog's parent widget is closed.
void SetCloseCallback(base::OnceClosure callback);
// Returns ownership of the extra view for this dialog, if one was provided