Commit edde9ce6 authored by Ella Ge's avatar Ella Ge Committed by Chromium LUCI CQ

Convert c/b/ui/webui/history from base::Bind to Once/Repeating

Bug: 1152282
Change-Id: I73c28fbaccb8d8c82402952730ffa1ac04423d09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601223Reviewed-by: default avatarJohn Lee <johntlee@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#839498}
parent a2db6922
......@@ -155,7 +155,7 @@ class BrowsingHistoryHandlerTest : public ChromeRenderViewHostTestHarness {
// Tests that BrowsingHistoryHandler is informed about WebHistoryService
// deletions.
TEST_F(BrowsingHistoryHandlerTest, ObservingWebHistoryDeletions) {
base::Callback<void(bool)> callback = base::DoNothing();
base::RepeatingCallback<void(bool)> callback = base::DoNothing();
// BrowsingHistoryHandler is informed about WebHistoryService history
// deletions.
......
......@@ -17,8 +17,8 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
HistoryLoginHandler::HistoryLoginHandler(const base::Closure& signin_callback)
: signin_callback_(signin_callback) {}
HistoryLoginHandler::HistoryLoginHandler(base::RepeatingClosure signin_callback)
: signin_callback_(std::move(signin_callback)) {}
HistoryLoginHandler::~HistoryLoginHandler() {}
......@@ -37,8 +37,8 @@ void HistoryLoginHandler::RegisterMessages() {
void HistoryLoginHandler::OnJavascriptAllowed() {
profile_info_watcher_ = std::make_unique<ProfileInfoWatcher>(
Profile::FromWebUI(web_ui()),
base::Bind(&HistoryLoginHandler::ProfileInfoChanged,
base::Unretained(this)));
base::BindRepeating(&HistoryLoginHandler::ProfileInfoChanged,
base::Unretained(this)));
ProfileInfoChanged();
}
......
......@@ -16,7 +16,7 @@ class ProfileInfoWatcher;
// The handler for login-related messages from chrome://history.
class HistoryLoginHandler : public content::WebUIMessageHandler {
public:
explicit HistoryLoginHandler(const base::Closure& signin_callback);
explicit HistoryLoginHandler(base::RepeatingClosure signin_callback);
~HistoryLoginHandler() override;
// WebUIMessageHandler implementation.
......@@ -38,7 +38,7 @@ class HistoryLoginHandler : public content::WebUIMessageHandler {
// changes).
std::unique_ptr<ProfileInfoWatcher> profile_info_watcher_;
base::Closure signin_callback_;
base::RepeatingClosure signin_callback_;
DISALLOW_COPY_AND_ASSIGN(HistoryLoginHandler);
};
......
......@@ -141,9 +141,9 @@ HistoryUI::HistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) {
foreign_session_handler.get();
web_ui->AddMessageHandler(std::move(foreign_session_handler));
foreign_session_handler_ptr->InitializeForeignSessions();
web_ui->AddMessageHandler(std::make_unique<HistoryLoginHandler>(
base::Bind(&HistoryUI::UpdateDataSource, base::Unretained(this))));
web_ui->AddMessageHandler(
std::make_unique<HistoryLoginHandler>(base::BindRepeating(
&HistoryUI::UpdateDataSource, base::Unretained(this))));
}
HistoryUI::~HistoryUI() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment