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" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 49 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
50 InputHandlerManagerClient* client, | 50 InputHandlerManagerClient* client, |
51 SynchronousInputHandlerProxyClient* sync_handler_client, | 51 SynchronousInputHandlerProxyClient* sync_handler_client, |
52 scheduler::RendererScheduler* renderer_scheduler); | 52 scheduler::RendererScheduler* renderer_scheduler); |
53 virtual ~InputHandlerManager(); | 53 virtual ~InputHandlerManager(); |
54 | 54 |
55 // Callable from the main thread only. | 55 // Callable from the main thread only. |
56 void AddInputHandler(int routing_id, | 56 void AddInputHandler(int routing_id, |
57 const base::WeakPtr<cc::InputHandler>& input_handler, | 57 const base::WeakPtr<cc::InputHandler>& input_handler, |
58 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 58 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
59 bool enable_smooth_scrolling); | 59 bool enable_smooth_scrolling, |
| 60 bool enable_wheel_gestures); |
60 | 61 |
61 void ObserveWheelEventAndResultOnMainThread( | 62 void ObserveWheelEventAndResultOnMainThread( |
62 int routing_id, | 63 int routing_id, |
63 const blink::WebMouseWheelEvent& wheel_event, | 64 const blink::WebMouseWheelEvent& wheel_event, |
64 const cc::InputHandlerScrollResult& scroll_result); | 65 const cc::InputHandlerScrollResult& scroll_result); |
65 | 66 |
66 void ObserveGestureEventAndResultOnMainThread( | 67 void ObserveGestureEventAndResultOnMainThread( |
67 int routing_id, | 68 int routing_id, |
68 const blink::WebGestureEvent& gesture_event, | 69 const blink::WebGestureEvent& gesture_event, |
69 const cc::InputHandlerScrollResult& scroll_result); | 70 const cc::InputHandlerScrollResult& scroll_result); |
(...skipping 20 matching lines...) Expand all Loading... |
90 // Called from the compositor's thread. | 91 // Called from the compositor's thread. |
91 void DidAnimateForInput(); | 92 void DidAnimateForInput(); |
92 | 93 |
93 private: | 94 private: |
94 // Called from the compositor's thread. | 95 // Called from the compositor's thread. |
95 void AddInputHandlerOnCompositorThread( | 96 void AddInputHandlerOnCompositorThread( |
96 int routing_id, | 97 int routing_id, |
97 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, | 98 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, |
98 const base::WeakPtr<cc::InputHandler>& input_handler, | 99 const base::WeakPtr<cc::InputHandler>& input_handler, |
99 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 100 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
100 bool enable_smooth_scrolling); | 101 bool enable_smooth_scrolling, |
| 102 bool enable_wheel_gestures); |
101 | 103 |
102 void ObserveWheelEventAndResultOnCompositorThread( | 104 void ObserveWheelEventAndResultOnCompositorThread( |
103 int routing_id, | 105 int routing_id, |
104 const blink::WebMouseWheelEvent& wheel_event, | 106 const blink::WebMouseWheelEvent& wheel_event, |
105 const cc::InputHandlerScrollResult& scroll_result); | 107 const cc::InputHandlerScrollResult& scroll_result); |
106 | 108 |
107 void ObserveGestureEventAndResultOnCompositorThread( | 109 void ObserveGestureEventAndResultOnCompositorThread( |
108 int routing_id, | 110 int routing_id, |
109 const blink::WebGestureEvent& gesture_event, | 111 const blink::WebGestureEvent& gesture_event, |
110 const cc::InputHandlerScrollResult& scroll_result); | 112 const cc::InputHandlerScrollResult& scroll_result); |
111 | 113 |
112 void NotifyInputEventHandledOnCompositorThread(int routing_id, | 114 void NotifyInputEventHandledOnCompositorThread(int routing_id, |
113 blink::WebInputEvent::Type); | 115 blink::WebInputEvent::Type); |
114 | 116 |
115 typedef base::ScopedPtrHashMap<int, // routing_id | 117 typedef base::ScopedPtrHashMap<int, // routing_id |
116 std::unique_ptr<InputHandlerWrapper>> | 118 std::unique_ptr<InputHandlerWrapper>> |
117 InputHandlerMap; | 119 InputHandlerMap; |
118 InputHandlerMap input_handlers_; | 120 InputHandlerMap input_handlers_; |
119 | 121 |
120 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 122 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
121 InputHandlerManagerClient* const client_; | 123 InputHandlerManagerClient* const client_; |
122 // May be null. | 124 // May be null. |
123 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; | 125 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; |
124 scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. | 126 scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. |
125 }; | 127 }; |
126 | 128 |
127 } // namespace content | 129 } // namespace content |
128 | 130 |
129 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 131 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
OLD | NEW |