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