Convert ui::PlatformEventWaiter::PlatformEventMatcher and Related Code to base::RepeatingCallback

BUG=714018,940130
TBR=sky@chromium.org

Change-Id: I2dcacc52febbe0aeb72e90fe390239d1cb9ac201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1525481
Reviewed-by: Robert Liao <robliao@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#641051}
diff --git a/ui/aura/test/ui_controls_factory_aurax11.cc b/ui/aura/test/ui_controls_factory_aurax11.cc
index 63d1998d..1b4db34 100644
--- a/ui/aura/test/ui_controls_factory_aurax11.cc
+++ b/ui/aura/test/ui_controls_factory_aurax11.cc
@@ -209,7 +209,8 @@
     }
     marker_event->xclient.message_type = MarkerEventAtom();
     PostEventToWindowTreeHost(*marker_event, host_);
-    ui::PlatformEventWaiter::Create(std::move(closure), base::Bind(&Matcher));
+    ui::PlatformEventWaiter::Create(std::move(closure),
+                                    base::BindRepeating(&Matcher));
   }
  private:
   void SetKeycodeAndSendThenMask(XEvent* xevent,
diff --git a/ui/events/test/platform_event_waiter.cc b/ui/events/test/platform_event_waiter.cc
index 3169bcc..7f645df 100644
--- a/ui/events/test/platform_event_waiter.cc
+++ b/ui/events/test/platform_event_waiter.cc
@@ -4,6 +4,8 @@
 
 #include "ui/events/test/platform_event_waiter.h"
 
+#include <utility>
+
 #include "base/location.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
@@ -11,11 +13,10 @@
 
 namespace ui {
 
-PlatformEventWaiter::PlatformEventWaiter(
-    base::OnceClosure success_callback,
-    const PlatformEventMatcher& event_matcher)
+PlatformEventWaiter::PlatformEventWaiter(base::OnceClosure success_callback,
+                                         PlatformEventMatcher event_matcher)
     : success_callback_(std::move(success_callback)),
-      event_matcher_(event_matcher) {
+      event_matcher_(std::move(event_matcher)) {
   PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
 }
 
@@ -37,8 +38,9 @@
 // static
 PlatformEventWaiter* PlatformEventWaiter::Create(
     base::OnceClosure success_callback,
-    const PlatformEventMatcher& event_matcher) {
-  return new PlatformEventWaiter(std::move(success_callback), event_matcher);
+    PlatformEventMatcher event_matcher) {
+  return new PlatformEventWaiter(std::move(success_callback),
+                                 std::move(event_matcher));
 }
 
 }  // namespace ui
diff --git a/ui/events/test/platform_event_waiter.h b/ui/events/test/platform_event_waiter.h
index 9c3ed4c..c43c56c 100644
--- a/ui/events/test/platform_event_waiter.h
+++ b/ui/events/test/platform_event_waiter.h
@@ -13,14 +13,15 @@
 
 class PlatformEventWaiter : public PlatformEventObserver {
  public:
-  typedef base::Callback<bool(const PlatformEvent&)> PlatformEventMatcher;
+  using PlatformEventMatcher =
+      base::RepeatingCallback<bool(const PlatformEvent&)>;
 
   static PlatformEventWaiter* Create(base::OnceClosure success_callback,
-                                     const PlatformEventMatcher& event_matcher);
+                                     PlatformEventMatcher event_matcher);
 
  private:
   PlatformEventWaiter(base::OnceClosure success_callback,
-                      const PlatformEventMatcher& event_matcher);
+                      PlatformEventMatcher event_matcher);
   ~PlatformEventWaiter() override;
 
   // PlatformEventObserver:
diff --git a/ui/views/test/ui_controls_factory_desktop_aurax11.cc b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
index 0180b30d..df718d54 100644
--- a/ui/views/test/ui_controls_factory_desktop_aurax11.cc
+++ b/ui/views/test/ui_controls_factory_desktop_aurax11.cc
@@ -237,7 +237,8 @@
     }
     marker_event->xclient.message_type = MarkerEventAtom();
     XSendEvent(x_display_, x_window_, x11::False, 0, marker_event);
-    ui::PlatformEventWaiter::Create(std::move(closure), base::Bind(&Matcher));
+    ui::PlatformEventWaiter::Create(std::move(closure),
+                                    base::BindRepeating(&Matcher));
   }
  private:
   aura::Window* RootWindowForPoint(const gfx::Point& point) {