Update V8 to version 4.7.16.
[chromium-blink-merge.git] / ui / events / test / platform_event_waiter.h
blobbdab29ed0bcd571a94a2230e7eb8e0cd8c572123
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_EVENTS_TEST_PLATFORM_EVENT_WAITER_H_
6 #define UI_EVENTS_TEST_PLATFORM_EVENT_WAITER_H_
8 #include "base/callback.h"
9 #include "ui/events/platform/platform_event_observer.h"
11 namespace ui {
13 class PlatformEventWaiter : public PlatformEventObserver {
14 public:
15 typedef base::Callback<bool(const PlatformEvent&)> PlatformEventMatcher;
17 static PlatformEventWaiter* Create(const base::Closure& success_callback,
18 const PlatformEventMatcher& event_matcher);
20 private:
21 PlatformEventWaiter(const base::Closure& success_callback,
22 const PlatformEventMatcher& event_matcher);
23 ~PlatformEventWaiter() override;
25 // PlatformEventObserver:
26 void WillProcessEvent(const PlatformEvent& event) override;
27 void DidProcessEvent(const PlatformEvent& event) override;
29 base::Closure success_callback_;
30 PlatformEventMatcher event_matcher_;
32 DISALLOW_COPY_AND_ASSIGN(PlatformEventWaiter);
35 } // namespace ui
37 #endif // UI_EVENTS_TEST_PLATFORM_EVENT_WAITER_H_