OLD | NEW |
| (Empty) |
1 // Copyright 2015 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. | |
4 | |
5 #ifndef SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ | |
6 #define SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/callback_forward.h" | |
11 | |
12 namespace ui { | |
13 class Event; | |
14 } | |
15 | |
16 namespace ui { | |
17 | |
18 class Window; | |
19 | |
20 namespace mojom { | |
21 enum class EventResult; | |
22 } | |
23 | |
24 // Responsible for processing input events for ui::Window. | |
25 class InputEventHandler { | |
26 public: | |
27 // The event handler can asynchronously ack the event by taking ownership of | |
28 // the |ack_callback|. The callback takes an EventResult indicating if the | |
29 // handler has consumed the event. If the handler does not take ownership of | |
30 // the callback, then WindowTreeClient will ack the event as not consumed. | |
31 virtual void OnWindowInputEvent( | |
32 Window* target, | |
33 const ui::Event& event, | |
34 std::unique_ptr<base::Callback<void(mojom::EventResult)>>* | |
35 ack_callback) = 0; | |
36 | |
37 protected: | |
38 virtual ~InputEventHandler() {} | |
39 }; | |
40 | |
41 } // namespace ui | |
42 | |
43 #endif // SERVICES_UI_PUBLIC_CPP_INPUT_EVENT_HANDLER_H_ | |
OLD | NEW |