Calling non-const callbacks requires some tricks
This commit is contained in:
parent
ce755483ba
commit
0291dc8214
1 changed files with 6 additions and 2 deletions
|
@ -44,7 +44,7 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
||||||
|
|
||||||
if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT &&
|
if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT &&
|
||||||
dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
|
dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_CONFIRM) {
|
||||||
callback.Run(false, base::string16());
|
std::move(callback).Run(false, base::string16());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
|
||||||
bool is_reload,
|
bool is_reload,
|
||||||
DialogClosedCallback callback) {
|
DialogClosedCallback callback) {
|
||||||
bool default_prevented = api_web_contents_->Emit("will-prevent-unload");
|
bool default_prevented = api_web_contents_->Emit("will-prevent-unload");
|
||||||
callback.Run(default_prevented, base::string16());
|
std::move(callback).Run(default_prevented, base::string16());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,9 +95,13 @@ void AtomJavaScriptDialogManager::OnMessageBoxCallback(
|
||||||
const std::string& origin,
|
const std::string& origin,
|
||||||
int code,
|
int code,
|
||||||
bool checkbox_checked) {
|
bool checkbox_checked) {
|
||||||
|
<<<<<<< HEAD
|
||||||
if (checkbox_checked)
|
if (checkbox_checked)
|
||||||
origin_counts_[origin] = kUserWantsNoMoreDialogs;
|
origin_counts_[origin] = kUserWantsNoMoreDialogs;
|
||||||
callback.Run(code == 0, base::string16());
|
callback.Run(code == 0, base::string16());
|
||||||
|
=======
|
||||||
|
std::move(callback).Run(code == 0, base::string16());
|
||||||
|
>>>>>>> Calling non-const callbacks requires some tricks
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue