Commit 746a2e20 authored by Leonard Grey's avatar Leonard Grey Committed by Chromium LUCI CQ

[Code Health] Convert callbacks in DevtoolsWindow to BindRepeating

Bug: 1152274
Change-Id: I96773aca058a77390d8f2e8ea818dd56cc7c5f4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2581462Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835679}
parent aa9d555e
......@@ -38,8 +38,8 @@ DevToolsEyeDropper::DevToolsEyeDropper(content::WebContents* web_contents,
last_cursor_x_(-1),
last_cursor_y_(-1),
host_(nullptr) {
mouse_event_callback_ =
base::Bind(&DevToolsEyeDropper::HandleMouseEvent, base::Unretained(this));
mouse_event_callback_ = base::BindRepeating(
&DevToolsEyeDropper::HandleMouseEvent, base::Unretained(this));
content::RenderViewHost* rvh =
web_contents->GetMainFrame()->GetRenderViewHost();
if (rvh)
......
......@@ -22,7 +22,7 @@ class WebMouseEvent;
class DevToolsEyeDropper : public content::WebContentsObserver,
public viz::mojom::FrameSinkVideoConsumer {
public:
typedef base::Callback<void(int, int, int, int)> EyeDropperCallback;
typedef base::RepeatingCallback<void(int, int, int, int)> EyeDropperCallback;
DevToolsEyeDropper(content::WebContents* web_contents,
EyeDropperCallback callback);
......
......@@ -1477,9 +1477,10 @@ void DevToolsWindow::SetEyeDropperActive(bool active) {
if (!web_contents)
return;
if (active) {
eye_dropper_.reset(new DevToolsEyeDropper(
web_contents, base::Bind(&DevToolsWindow::ColorPickedInEyeDropper,
base::Unretained(this))));
eye_dropper_ = std::make_unique<DevToolsEyeDropper>(
web_contents,
base::BindRepeating(&DevToolsWindow::ColorPickedInEyeDropper,
base::Unretained(this)));
} else {
eye_dropper_.reset();
}
......
......@@ -256,7 +256,7 @@ class DevToolsWindow : public DevToolsUIBindings::Delegate,
friend class DevToolsWindowCreationObserver;
friend class HatsNextWebDialogBrowserTest;
using CreationCallback = base::Callback<void(DevToolsWindow*)>;
using CreationCallback = base::RepeatingCallback<void(DevToolsWindow*)>;
static void AddCreationCallbackForTest(const CreationCallback& callback);
static void RemoveCreationCallbackForTest(const CreationCallback& callback);
......
......@@ -180,7 +180,7 @@ void DevToolsWindowTesting::CloseDevToolsWindowSync(
// DevToolsWindowCreationObserver ---------------------------------------------
DevToolsWindowCreationObserver::DevToolsWindowCreationObserver()
: creation_callback_(base::Bind(
: creation_callback_(base::BindRepeating(
&DevToolsWindowCreationObserver::DevToolsWindowCreated,
base::Unretained(this))) {
DevToolsWindow::AddCreationCallbackForTest(creation_callback_);
......
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