OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/memory/weak_ptr.h" |
| 11 |
| 12 namespace cc { |
| 13 class InputHandler; |
| 14 } |
10 | 15 |
11 namespace WebKit { | 16 namespace WebKit { |
12 class WebInputEvent; | 17 class WebInputEvent; |
13 } | 18 } |
14 | 19 |
15 namespace content { | 20 namespace content { |
16 | 21 |
17 class InputHandlerManagerClient { | 22 class InputHandlerManagerClient { |
18 public: | 23 public: |
19 virtual ~InputHandlerManagerClient() {} | 24 virtual ~InputHandlerManagerClient() {} |
20 | 25 |
21 // The Manager will supply a |handler| when bound to the client. This is valid | 26 // The Manager will supply a |handler| when bound to the client. This is valid |
22 // until the manager shuts down, at which point it supplies a null |handler|. | 27 // until the manager shuts down, at which point it supplies a null |handler|. |
23 // The client should only makes calls to |handler| on the compositing thread. | 28 // The client should only makes calls to |handler| on the compositing thread. |
24 typedef base::Callback<InputEventAckState( | 29 typedef base::Callback<InputEventAckState( |
25 int /*routing_id*/, const WebKit::WebInputEvent&)> Handler; | 30 int /*routing_id*/, const WebKit::WebInputEvent&)> Handler; |
26 | 31 |
27 // Called from the main thread. | 32 // Called from the main thread. |
28 virtual void SetBoundHandler(const Handler& handler) = 0; | 33 virtual void SetBoundHandler(const Handler& handler) = 0; |
29 | 34 |
30 // Called from the compositor thread. | 35 // Called from the compositor thread. |
31 virtual void DidAddInputHandler(int routing_id) = 0; | 36 virtual void DidAddInputHandler( |
| 37 int routing_id, |
| 38 base::WeakPtr<cc::InputHandler> input_handler) = 0; |
32 virtual void DidRemoveInputHandler(int routing_id) = 0; | 39 virtual void DidRemoveInputHandler(int routing_id) = 0; |
33 | 40 |
34 protected: | 41 protected: |
35 InputHandlerManagerClient() {} | 42 InputHandlerManagerClient() {} |
36 | 43 |
37 private: | 44 private: |
38 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); | 45 DISALLOW_COPY_AND_ASSIGN(InputHandlerManagerClient); |
39 }; | 46 }; |
40 | 47 |
41 } // namespace content | 48 } // namespace content |
42 | 49 |
43 #endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ | 50 #endif // CONTENT_COMMON_GPU_INPUT_HANDLER_MANAGER_CLIENT_H_ |
OLD | NEW |