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_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
7 | 7 |
8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.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 "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
17 } | 17 } |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 class InputHandler; | 20 class InputHandler; |
21 struct InputHandlerScrollResult; | 21 struct InputHandlerScrollResult; |
22 } | 22 } |
23 | 23 |
24 namespace blink { | 24 namespace blink { |
25 class WebInputEvent; | 25 class WebInputEvent; |
26 class WebMouseWheelEvent; | 26 class WebMouseWheelEvent; |
27 } | 27 } |
28 | 28 |
| 29 namespace blink { |
29 namespace scheduler { | 30 namespace scheduler { |
30 class RendererScheduler; | 31 class RendererScheduler; |
31 } | 32 } |
| 33 } |
32 | 34 |
33 namespace content { | 35 namespace content { |
34 | 36 |
35 class InputHandlerWrapper; | 37 class InputHandlerWrapper; |
36 class SynchronousInputHandlerProxyClient; | 38 class SynchronousInputHandlerProxyClient; |
37 class InputHandlerManagerClient; | 39 class InputHandlerManagerClient; |
38 struct DidOverscrollParams; | 40 struct DidOverscrollParams; |
39 | 41 |
40 // InputHandlerManager class manages InputHandlerProxy instances for | 42 // InputHandlerManager class manages InputHandlerProxy instances for |
41 // the WebViews in this renderer. | 43 // the WebViews in this renderer. |
42 class CONTENT_EXPORT InputHandlerManager { | 44 class CONTENT_EXPORT InputHandlerManager { |
43 public: | 45 public: |
44 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The | 46 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The |
45 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| | 47 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| |
46 // must outlive this object. The RendererScheduler needs to know when input | 48 // must outlive this object. The RendererScheduler needs to know when input |
47 // events and fling animations occur, which is why it's passed in here. | 49 // events and fling animations occur, which is why it's passed in here. |
48 InputHandlerManager( | 50 InputHandlerManager( |
49 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 51 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
50 InputHandlerManagerClient* client, | 52 InputHandlerManagerClient* client, |
51 SynchronousInputHandlerProxyClient* sync_handler_client, | 53 SynchronousInputHandlerProxyClient* sync_handler_client, |
52 scheduler::RendererScheduler* renderer_scheduler); | 54 blink::scheduler::RendererScheduler* renderer_scheduler); |
53 virtual ~InputHandlerManager(); | 55 virtual ~InputHandlerManager(); |
54 | 56 |
55 // Callable from the main thread only. | 57 // Callable from the main thread only. |
56 void AddInputHandler(int routing_id, | 58 void AddInputHandler(int routing_id, |
57 const base::WeakPtr<cc::InputHandler>& input_handler, | 59 const base::WeakPtr<cc::InputHandler>& input_handler, |
58 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 60 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
59 bool enable_smooth_scrolling); | 61 bool enable_smooth_scrolling); |
60 | 62 |
61 void RegisterRoutingID(int routing_id); | 63 void RegisterRoutingID(int routing_id); |
62 void UnregisterRoutingID(int routing_id); | 64 void UnregisterRoutingID(int routing_id); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 115 |
114 typedef base::ScopedPtrHashMap<int, // routing_id | 116 typedef base::ScopedPtrHashMap<int, // routing_id |
115 std::unique_ptr<InputHandlerWrapper>> | 117 std::unique_ptr<InputHandlerWrapper>> |
116 InputHandlerMap; | 118 InputHandlerMap; |
117 InputHandlerMap input_handlers_; | 119 InputHandlerMap input_handlers_; |
118 | 120 |
119 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 121 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
120 InputHandlerManagerClient* const client_; | 122 InputHandlerManagerClient* const client_; |
121 // May be null. | 123 // May be null. |
122 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; | 124 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; |
123 scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. | 125 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. |
124 }; | 126 }; |
125 | 127 |
126 } // namespace content | 128 } // namespace content |
127 | 129 |
128 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 130 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
OLD | NEW |