| 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 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 class InputHandler; | 20 class InputHandler; |
| 21 struct InputHandlerScrollResult; | 21 struct InputHandlerScrollResult; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace blink { | 24 namespace blink { |
| 25 class WebInputEvent; | 25 class WebInputEvent; |
| 26 class WebMouseWheelEvent; | 26 class WebMouseWheelEvent; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace blink { |
| 29 namespace scheduler { | 30 namespace scheduler { |
| 30 class RendererScheduler; | 31 class RendererScheduler; |
| 31 } | 32 } |
| 33 } |
| 32 | 34 |
| 33 namespace content { | 35 namespace content { |
| 34 | 36 |
| 35 class InputHandlerWrapper; | 37 class InputHandlerWrapper; |
| 36 class SynchronousInputHandlerProxyClient; | 38 class SynchronousInputHandlerProxyClient; |
| 37 class InputHandlerManagerClient; | 39 class InputHandlerManagerClient; |
| 38 struct DidOverscrollParams; | 40 struct DidOverscrollParams; |
| 39 | 41 |
| 40 // InputHandlerManager class manages InputHandlerProxy instances for | 42 // InputHandlerManager class manages InputHandlerProxy instances for |
| 41 // the WebViews in this renderer. | 43 // the WebViews in this renderer. |
| 42 class CONTENT_EXPORT InputHandlerManager { | 44 class CONTENT_EXPORT InputHandlerManager { |
| 43 public: | 45 public: |
| 44 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The | 46 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The |
| 45 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| | 47 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| |
| 46 // must outlive this object. The RendererScheduler needs to know when input | 48 // must outlive this object. The RendererScheduler needs to know when input |
| 47 // events and fling animations occur, which is why it's passed in here. | 49 // events and fling animations occur, which is why it's passed in here. |
| 48 InputHandlerManager( | 50 InputHandlerManager( |
| 49 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 51 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 50 InputHandlerManagerClient* client, | 52 InputHandlerManagerClient* client, |
| 51 SynchronousInputHandlerProxyClient* sync_handler_client, | 53 SynchronousInputHandlerProxyClient* sync_handler_client, |
| 52 scheduler::RendererScheduler* renderer_scheduler); | 54 blink::scheduler::RendererScheduler* renderer_scheduler); |
| 53 virtual ~InputHandlerManager(); | 55 virtual ~InputHandlerManager(); |
| 54 | 56 |
| 55 // Callable from the main thread only. | 57 // Callable from the main thread only. |
| 56 void AddInputHandler(int routing_id, | 58 void AddInputHandler(int routing_id, |
| 57 const base::WeakPtr<cc::InputHandler>& input_handler, | 59 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 58 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 60 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
| 59 bool enable_smooth_scrolling); | 61 bool enable_smooth_scrolling); |
| 60 | 62 |
| 61 void RegisterRoutingID(int routing_id); | 63 void RegisterRoutingID(int routing_id); |
| 62 void UnregisterRoutingID(int routing_id); | 64 void UnregisterRoutingID(int routing_id); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 119 |
| 118 typedef base::ScopedPtrHashMap<int, // routing_id | 120 typedef base::ScopedPtrHashMap<int, // routing_id |
| 119 std::unique_ptr<InputHandlerWrapper>> | 121 std::unique_ptr<InputHandlerWrapper>> |
| 120 InputHandlerMap; | 122 InputHandlerMap; |
| 121 InputHandlerMap input_handlers_; | 123 InputHandlerMap input_handlers_; |
| 122 | 124 |
| 123 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 125 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 124 InputHandlerManagerClient* const client_; | 126 InputHandlerManagerClient* const client_; |
| 125 // May be null. | 127 // May be null. |
| 126 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; | 128 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; |
| 127 scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. | 129 blink::scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace content | 132 } // namespace content |
| 131 | 133 |
| 132 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 134 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
| OLD | NEW |