OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ |
6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 #include "content/common/input/input_event_ack_state.h" | 12 #include "content/common/input/input_event_ack_state.h" |
13 #include "ui/gfx/geometry/vector2d_f.h" | 13 #include "ui/gfx/geometry/vector2d_f.h" |
14 | 14 |
15 namespace ui { | 15 namespace ui { |
16 class LatencyInfo; | 16 class LatencyInfo; |
17 } | 17 } |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 class InputHandler; | 20 class InputHandler; |
21 } | 21 } |
22 | 22 |
23 namespace blink { | 23 namespace blink { |
24 class WebInputEvent; | 24 class WebInputEvent; |
25 } | 25 } |
26 | 26 |
| 27 namespace ui { |
| 28 class SynchronousInputHandlerProxy; |
| 29 } |
| 30 |
27 namespace content { | 31 namespace content { |
28 struct DidOverscrollParams; | 32 struct DidOverscrollParams; |
29 class SynchronousInputHandlerProxy; | |
30 | 33 |
31 class CONTENT_EXPORT InputHandlerManagerClient { | 34 class CONTENT_EXPORT InputHandlerManagerClient { |
32 public: | 35 public: |
33 virtual ~InputHandlerManagerClient() {} | 36 virtual ~InputHandlerManagerClient() {} |
34 | 37 |
35 // The Manager will supply a |handler| when bound to the client. This is valid | 38 // The Manager will supply a |handler| when bound to the client. This is valid |
36 // until the manager shuts down, at which point it supplies a null |handler|. | 39 // until the manager shuts down, at which point it supplies a null |handler|. |
37 // The client should only makes calls to |handler| on the compositor thread. | 40 // The client should only makes calls to |handler| on the compositor thread. |
38 typedef base::Callback< | 41 typedef base::Callback< |
39 InputEventAckState(int /*routing_id*/, | 42 InputEventAckState(int /*routing_id*/, |
40 const blink::WebInputEvent*, | 43 const blink::WebInputEvent*, |
41 ui::LatencyInfo* latency_info)> Handler; | 44 ui::LatencyInfo* latency_info)> Handler; |
42 | 45 |
43 // Called from the main thread. | 46 // Called from the main thread. |
44 virtual void SetBoundHandler(const Handler& handler) = 0; | 47 virtual void SetBoundHandler(const Handler& handler) = 0; |
45 | 48 |
46 // Called from the compositor thread. | 49 // Called from the compositor thread. |
47 virtual void DidAddInputHandler( | 50 virtual void DidAddInputHandler( |
48 int routing_id, | 51 int routing_id, |
49 SynchronousInputHandlerProxy* synchronous_handler) = 0; | 52 ui::SynchronousInputHandlerProxy* synchronous_handler) = 0; |
50 virtual void DidRemoveInputHandler(int routing_id) = 0; | 53 virtual void DidRemoveInputHandler(int routing_id) = 0; |
51 virtual void DidOverscroll(int routing_id, | 54 virtual void DidOverscroll(int routing_id, |
52 const DidOverscrollParams& params) = 0; | 55 const DidOverscrollParams& params) = 0; |
53 virtual void DidStopFlinging(int routing_id) = 0; | 56 virtual void DidStopFlinging(int routing_id) = 0; |
54 | 57 |
55 protected: | 58 protected: |
56 InputHandlerManagerClient() {} | 59 InputHandlerManagerClient() {} |
57 | 60 |
58 private: | 61 private: |
59 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); | 62 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace content | 65 } // namespace content |
63 | 66 |
64 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ | 67 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_CLIENT_H_ |
OLD | NEW |