| 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 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h" |
| 14 #include "ui/events/blink/input_handler_proxy.h" | 15 #include "ui/events/blink/input_handler_proxy.h" |
| 15 | 16 |
| 16 namespace base { | 17 namespace base { |
| 17 class SingleThreadTaskRunner; | 18 class SingleThreadTaskRunner; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace cc { | 21 namespace cc { |
| 21 class InputHandler; | 22 class InputHandler; |
| 22 struct InputHandlerScrollResult; | 23 struct InputHandlerScrollResult; |
| 23 } | 24 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void NotifyInputEventHandledOnMainThread(int routing_id, | 76 void NotifyInputEventHandledOnMainThread(int routing_id, |
| 76 blink::WebInputEvent::Type, | 77 blink::WebInputEvent::Type, |
| 77 InputEventAckState); | 78 InputEventAckState); |
| 78 void ProcessRafAlignedInputOnMainThread(int routing_id); | 79 void ProcessRafAlignedInputOnMainThread(int routing_id); |
| 79 | 80 |
| 80 // Callback only from the compositor's thread. | 81 // Callback only from the compositor's thread. |
| 81 void RemoveInputHandler(int routing_id); | 82 void RemoveInputHandler(int routing_id); |
| 82 | 83 |
| 83 using InputEventAckStateCallback = | 84 using InputEventAckStateCallback = |
| 84 base::Callback<void(InputEventAckState, | 85 base::Callback<void(InputEventAckState, |
| 85 ui::ScopedWebInputEvent, | 86 blink::ScopedWebCoalescedInputEvent, |
| 86 const ui::LatencyInfo&, | 87 const ui::LatencyInfo&, |
| 87 std::unique_ptr<ui::DidOverscrollParams>)>; | 88 std::unique_ptr<ui::DidOverscrollParams>)>; |
| 88 // Called from the compositor's thread. | 89 // Called from the compositor's thread. |
| 89 virtual void HandleInputEvent(int routing_id, | 90 virtual void HandleInputEvent(int routing_id, |
| 90 ui::ScopedWebInputEvent input_event, | 91 blink::ScopedWebCoalescedInputEvent input_event, |
| 91 const ui::LatencyInfo& latency_info, | 92 const ui::LatencyInfo& latency_info, |
| 92 const InputEventAckStateCallback& callback); | 93 const InputEventAckStateCallback& callback); |
| 93 | 94 |
| 94 // Called from the compositor's thread. | 95 // Called from the compositor's thread. |
| 95 void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params); | 96 void DidOverscroll(int routing_id, const ui::DidOverscrollParams& params); |
| 96 | 97 |
| 97 // Called from the compositor's thread. | 98 // Called from the compositor's thread. |
| 98 void DidStopFlinging(int routing_id); | 99 void DidStopFlinging(int routing_id); |
| 99 | 100 |
| 100 // Called from the compositor's thread. | 101 // Called from the compositor's thread. |
| 101 void DidAnimateForInput(); | 102 void DidAnimateForInput(); |
| 102 | 103 |
| 103 // Called from the compositor's thread. | 104 // Called from the compositor's thread. |
| 104 void NeedsMainFrame(int routing_id); | 105 void NeedsMainFrame(int routing_id); |
| 105 | 106 |
| 106 // Called from the compositor's thread. | 107 // Called from the compositor's thread. |
| 107 void DispatchNonBlockingEventToMainThread( | 108 void DispatchNonBlockingEventToMainThread( |
| 108 int routing_id, | 109 int routing_id, |
| 109 ui::ScopedWebInputEvent event, | 110 blink::WebCoalescedInputEvent::ScopedWebInputEvent event, |
| 110 const ui::LatencyInfo& latency_info); | 111 const ui::LatencyInfo& latency_info); |
| 111 | 112 |
| 112 private: | 113 private: |
| 113 // Called from the compositor's thread. | 114 // Called from the compositor's thread. |
| 114 void AddInputHandlerOnCompositorThread( | 115 void AddInputHandlerOnCompositorThread( |
| 115 int routing_id, | 116 int routing_id, |
| 116 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, | 117 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, |
| 117 const base::WeakPtr<cc::InputHandler>& input_handler, | 118 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 118 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 119 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
| 119 bool enable_smooth_scrolling); | 120 bool enable_smooth_scrolling); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 148 // May be null. | 149 // May be null. |
| 149 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; | 150 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; |
| 150 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. | 151 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. |
| 151 | 152 |
| 152 base::WeakPtrFactory<InputHandlerManager> weak_ptr_factory_; | 153 base::WeakPtrFactory<InputHandlerManager> weak_ptr_factory_; |
| 153 }; | 154 }; |
| 154 | 155 |
| 155 } // namespace content | 156 } // namespace content |
| 156 | 157 |
| 157 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 158 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
| OLD | NEW |