Commit 28a2a70c authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert ui/aura away from base::Bind/base::Callback

base::Bind/base::Callback are deprecated in favor of either
base::BindOnce/base::OnceCallback or base::BindRepeating/
base::RepeatingCallback (depending on whether the callback
is invoked once or multiple time).

Convert all uses of base::Bind/base::Callback in ui/aura
to the recommended methods/types.

Bug: 1007846
Change-Id: Id5f2c026950df6d651830d9ff07dd95ac3e0f153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832804
Auto-Submit: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701721}
parent 8af75fc7
...@@ -2454,7 +2454,8 @@ TEST_F(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) { ...@@ -2454,7 +2454,8 @@ TEST_F(WindowEventDispatcherTestInHighDPI, TouchMovesHeldOnScroll) {
// event, and runs a single callback in the nested run loop. // event, and runs a single callback in the nested run loop.
class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler { class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler {
public: public:
explicit TriggerNestedLoopOnRightMousePress(const base::Closure& callback) explicit TriggerNestedLoopOnRightMousePress(
const base::RepeatingClosure& callback)
: callback_(callback) {} : callback_(callback) {}
~TriggerNestedLoopOnRightMousePress() override {} ~TriggerNestedLoopOnRightMousePress() override {}
...@@ -2477,7 +2478,7 @@ class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler { ...@@ -2477,7 +2478,7 @@ class TriggerNestedLoopOnRightMousePress : public ui::test::TestEventHandler {
} }
} }
base::Closure callback_; base::RepeatingClosure callback_;
gfx::Point mouse_move_location_; gfx::Point mouse_move_location_;
DISALLOW_COPY_AND_ASSIGN(TriggerNestedLoopOnRightMousePress); DISALLOW_COPY_AND_ASSIGN(TriggerNestedLoopOnRightMousePress);
...@@ -2495,7 +2496,7 @@ TEST_F(WindowEventDispatcherTestInHighDPI, ...@@ -2495,7 +2496,7 @@ TEST_F(WindowEventDispatcherTestInHighDPI,
ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, gfx::Point(80, 80), ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, gfx::Point(80, 80),
gfx::Point(80, 80), ui::EventTimeForNow(), gfx::Point(80, 80), ui::EventTimeForNow(),
ui::EF_NONE, ui::EF_NONE); ui::EF_NONE, ui::EF_NONE);
const base::Closure callback_on_right_click = base::Bind( base::RepeatingClosure callback_on_right_click = base::BindRepeating(
base::IgnoreResult(&WindowEventDispatcherTestInHighDPI::DispatchEvent), base::IgnoreResult(&WindowEventDispatcherTestInHighDPI::DispatchEvent),
base::Unretained(this), base::Unretained(&mouse_move)); base::Unretained(this), base::Unretained(&mouse_move));
TriggerNestedLoopOnRightMousePress handler(callback_on_right_click); TriggerNestedLoopOnRightMousePress handler(callback_on_right_click);
......
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