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