Fix build error caused by base::Passed changes

This commit is contained in:
Cheng Zhao 2018-03-12 17:27:43 +09:00 коммит произвёл Aleksei Kuzmin
Родитель b08d086b0f
Коммит d141d2445d
3 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -37,9 +37,9 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
const base::string16& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
const std::string origin = origin_url.GetOrigin().spec();
const std::string& origin = origin_url.GetOrigin().spec();
if (origin_counts_[origin] == kUserWantsNoMoreDialogs) {
return callback.Run(false, base::string16());
return std::move(callback).Run(false, base::string16());
}
if (dialog_type != JavaScriptDialogType::JAVASCRIPT_DIALOG_TYPE_ALERT &&
@ -73,7 +73,9 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
base::UTF16ToUTF8(message_text), "", checkbox_string,
false, gfx::ImageSkia(),
base::Bind(&AtomJavaScriptDialogManager::OnMessageBoxCallback,
base::Unretained(this), callback, origin));
base::Unretained(this),
base::Passed(std::move(callback)),
origin));
}
void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
@ -91,13 +93,13 @@ void AtomJavaScriptDialogManager::CancelDialogs(
}
void AtomJavaScriptDialogManager::OnMessageBoxCallback(
const DialogClosedCallback& callback,
DialogClosedCallback callback,
const std::string& origin,
int code,
bool checkbox_checked) {
if (checkbox_checked)
origin_counts_[origin] = kUserWantsNoMoreDialogs;
callback.Run(code == 0, base::string16());
std::move(callback).Run(code == 0, base::string16());
}
} // namespace atom

Просмотреть файл

@ -37,7 +37,7 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
bool reset_state) override;
private:
void OnMessageBoxCallback(const DialogClosedCallback& callback,
void OnMessageBoxCallback(DialogClosedCallback callback,
const std::string& origin,
int code,
bool checkbox_checked);

Просмотреть файл

@ -16,6 +16,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "cc/base/switches.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"