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 <unordered_map> | 8 #include <unordered_map> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Callable from the main thread only. | 62 // Callable from the main thread only. |
63 void AddInputHandler(int routing_id, | 63 void AddInputHandler(int routing_id, |
64 const base::WeakPtr<cc::InputHandler>& input_handler, | 64 const base::WeakPtr<cc::InputHandler>& input_handler, |
65 const base::WeakPtr<RenderWidget>& render_widget, | 65 const base::WeakPtr<RenderWidget>& render_widget, |
66 bool enable_smooth_scrolling); | 66 bool enable_smooth_scrolling); |
67 | 67 |
68 void RegisterRoutingID(int routing_id); | 68 void RegisterRoutingID(int routing_id); |
69 void UnregisterRoutingID(int routing_id); | 69 void UnregisterRoutingID(int routing_id); |
70 | 70 |
| 71 void AssociateRenderFrameRoutingID(int render_frame_routing_id, |
| 72 int render_view_routing_id); |
| 73 void AssociateRenderFrameRoutingIDOnCompositorThread( |
| 74 int render_frame_routing_id, |
| 75 int render_view_routing_id); |
| 76 |
71 void ObserveGestureEventAndResultOnMainThread( | 77 void ObserveGestureEventAndResultOnMainThread( |
72 int routing_id, | 78 int routing_id, |
73 const blink::WebGestureEvent& gesture_event, | 79 const blink::WebGestureEvent& gesture_event, |
74 const cc::InputHandlerScrollResult& scroll_result); | 80 const cc::InputHandlerScrollResult& scroll_result); |
75 | 81 |
76 void NotifyInputEventHandledOnMainThread(int routing_id, | 82 void NotifyInputEventHandledOnMainThread(int routing_id, |
77 blink::WebInputEvent::Type, | 83 blink::WebInputEvent::Type, |
78 blink::WebInputEventResult, | 84 blink::WebInputEventResult, |
79 InputEventAckState); | 85 InputEventAckState); |
80 void ProcessRafAlignedInputOnMainThread(int routing_id, | 86 void ProcessRafAlignedInputOnMainThread(int routing_id, |
81 base::TimeTicks frame_time); | 87 base::TimeTicks frame_time); |
82 | 88 |
83 // Callback only from the compositor's thread. | 89 // Callback only from the compositor's thread. |
84 void RemoveInputHandler(int routing_id); | 90 void RemoveInputHandler(int routing_id); |
85 | 91 |
86 using InputEventAckStateCallback = | 92 using InputEventAckStateCallback = |
87 base::Callback<void(InputEventAckState, | 93 base::Callback<void(InputEventAckState, |
88 ui::WebScopedInputEvent, | 94 ui::WebScopedInputEvent, |
89 const ui::LatencyInfo&, | 95 const ui::LatencyInfo&, |
90 std::unique_ptr<ui::DidOverscrollParams>)>; | 96 std::unique_ptr<ui::DidOverscrollParams>)>; |
91 // Called from the compositor's thread. | 97 // Called from the compositor's thread. |
92 virtual void HandleInputEvent(int routing_id, | 98 virtual void HandleInputEvent(int routing_id, |
93 ui::WebScopedInputEvent input_event, | 99 ui::WebScopedInputEvent input_event, |
94 const ui::LatencyInfo& latency_info, | 100 const ui::LatencyInfo& latency_info, |
95 const InputEventAckStateCallback& callback); | 101 const InputEventAckStateCallback& callback); |
96 | 102 |
| 103 virtual void QueueClosureForMainThreadEventQueue( |
| 104 int routing_id, |
| 105 const base::Closure& closure); |
97 // Called from the compositor's thread. | 106 // Called from the compositor's thread. |
98 void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params); | 107 void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params); |
99 | 108 |
100 // Called from the compositor's thread. | 109 // Called from the compositor's thread. |
101 void DidStopFlinging(int routing_id); | 110 void DidStopFlinging(int routing_id); |
102 | 111 |
103 // Called from the compositor's thread. | 112 // Called from the compositor's thread. |
104 void DidAnimateForInput(); | 113 void DidAnimateForInput(); |
105 | 114 |
106 // Called from the compositor's thread. | 115 // Called from the compositor's thread. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 // May be null. | 160 // May be null. |
152 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; | 161 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; |
153 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. | 162 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. |
154 | 163 |
155 base::WeakPtrFactory<InputHandlerManager> weak_ptr_factory_; | 164 base::WeakPtrFactory<InputHandlerManager> weak_ptr_factory_; |
156 }; | 165 }; |
157 | 166 |
158 } // namespace content | 167 } // namespace content |
159 | 168 |
160 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 169 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
OLD | NEW |