feat: promisify dialog.showMessageBox() (#17298)
* feat: promisify dialog.showMessageBox() * address feedback from review
This commit is contained in:
parent
ea6a926494
commit
8991c0056e
7 changed files with 234 additions and 191 deletions
|
@ -32,19 +32,19 @@ enum MessageBoxOptions {
|
|||
MESSAGE_BOX_NO_LINK = 1 << 0,
|
||||
};
|
||||
|
||||
typedef base::Callback<void(int code, bool checkbox_checked)>
|
||||
MessageBoxCallback;
|
||||
int ShowMessageBoxSync(NativeWindow* parent_window,
|
||||
MessageBoxType type,
|
||||
const std::vector<std::string>& buttons,
|
||||
int default_id,
|
||||
int cancel_id,
|
||||
int options,
|
||||
const std::string& title,
|
||||
const std::string& message,
|
||||
const std::string& detail,
|
||||
const gfx::ImageSkia& icon);
|
||||
|
||||
int ShowMessageBox(NativeWindow* parent_window,
|
||||
MessageBoxType type,
|
||||
const std::vector<std::string>& buttons,
|
||||
int default_id,
|
||||
int cancel_id,
|
||||
int options,
|
||||
const std::string& title,
|
||||
const std::string& message,
|
||||
const std::string& detail,
|
||||
const gfx::ImageSkia& icon);
|
||||
typedef base::OnceCallback<void(int code, bool checkbox_checked)>
|
||||
MessageBoxCallback;
|
||||
|
||||
void ShowMessageBox(NativeWindow* parent_window,
|
||||
MessageBoxType type,
|
||||
|
@ -58,7 +58,7 @@ void ShowMessageBox(NativeWindow* parent_window,
|
|||
const std::string& checkbox_label,
|
||||
bool checkbox_checked,
|
||||
const gfx::ImageSkia& icon,
|
||||
const MessageBoxCallback& callback);
|
||||
MessageBoxCallback callback);
|
||||
|
||||
// Like ShowMessageBox with simplest settings, but safe to call at very early
|
||||
// stage of application.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue