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_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ | 5 #ifndef CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
6 #define CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ | 6 #define CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 struct LatencyInfo; | 13 struct LatencyInfo; |
14 } | 14 } |
15 | 15 |
| 16 namespace cc { |
| 17 class InputHandler; |
| 18 } |
| 19 |
16 namespace WebKit { | 20 namespace WebKit { |
17 class WebInputEvent; | 21 class WebInputEvent; |
18 } | 22 } |
19 | 23 |
20 namespace content { | 24 namespace content { |
21 | 25 |
22 class CONTENT_EXPORT InputHandlerManagerClient { | 26 class CONTENT_EXPORT InputHandlerManagerClient { |
23 public: | 27 public: |
24 virtual ~InputHandlerManagerClient() {} | 28 virtual ~InputHandlerManagerClient() {} |
25 | 29 |
26 // The Manager will supply a |handler| when bound to the client. This is valid | 30 // The Manager will supply a |handler| when bound to the client. This is valid |
27 // until the manager shuts down, at which point it supplies a null |handler|. | 31 // until the manager shuts down, at which point it supplies a null |handler|. |
28 // The client should only makes calls to |handler| on the compositor thread. | 32 // The client should only makes calls to |handler| on the compositor thread. |
29 typedef base::Callback< | 33 typedef base::Callback< |
30 InputEventAckState(int /*routing_id*/, | 34 InputEventAckState(int /*routing_id*/, |
31 const WebKit::WebInputEvent*, | 35 const WebKit::WebInputEvent*, |
32 const ui::LatencyInfo& latency_info)> Handler; | 36 const ui::LatencyInfo& latency_info)> Handler; |
33 | 37 |
34 // Called from the main thread. | 38 // Called from the main thread. |
35 virtual void SetBoundHandler(const Handler& handler) = 0; | 39 virtual void SetBoundHandler(const Handler& handler) = 0; |
36 | 40 |
37 // Called from the compositor thread. | 41 // Called from the compositor thread. |
38 virtual void DidAddInputHandler(int routing_id) = 0; | 42 virtual void DidAddInputHandler(int routing_id, |
| 43 cc::InputHandler* input_handler) = 0; |
39 virtual void DidRemoveInputHandler(int routing_id) = 0; | 44 virtual void DidRemoveInputHandler(int routing_id) = 0; |
40 | 45 |
41 protected: | 46 protected: |
42 InputHandlerManagerClient() {} | 47 InputHandlerManagerClient() {} |
43 | 48 |
44 private: | 49 private: |
45 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); | 50 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); |
46 }; | 51 }; |
47 | 52 |
48 } // namespace content | 53 } // namespace content |
49 | 54 |
50 #endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ | 55 #endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
OLD | NEW |