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 14 matching lines...) Expand all Loading... |
25 class WebMouseWheelEvent; | 25 class WebMouseWheelEvent; |
26 } | 26 } |
27 | 27 |
28 namespace scheduler { | 28 namespace scheduler { |
29 class RendererScheduler; | 29 class RendererScheduler; |
30 } | 30 } |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 class InputHandlerWrapper; | 34 class InputHandlerWrapper; |
| 35 class SynchronousInputHandlerProxyClient; |
35 class InputHandlerManagerClient; | 36 class InputHandlerManagerClient; |
36 struct DidOverscrollParams; | 37 struct DidOverscrollParams; |
37 | 38 |
38 // InputHandlerManager class manages InputHandlerProxy instances for | 39 // InputHandlerManager class manages InputHandlerProxy instances for |
39 // the WebViews in this renderer. | 40 // the WebViews in this renderer. |
40 class InputHandlerManager { | 41 class InputHandlerManager { |
41 public: | 42 public: |
42 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The | 43 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The |
43 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| | 44 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| |
44 // must outlive this object. The RendererScheduler needs to know when input | 45 // must outlive this object. The RendererScheduler needs to know when input |
45 // events and fling animations occur, which is why it's passed in here. | 46 // events and fling animations occur, which is why it's passed in here. |
46 InputHandlerManager( | 47 InputHandlerManager( |
47 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 48 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
48 InputHandlerManagerClient* client, | 49 InputHandlerManagerClient* client, |
| 50 SynchronousInputHandlerProxyClient* sync_handler_client, |
49 scheduler::RendererScheduler* renderer_scheduler); | 51 scheduler::RendererScheduler* renderer_scheduler); |
50 ~InputHandlerManager(); | 52 ~InputHandlerManager(); |
51 | 53 |
52 // Callable from the main thread only. | 54 // Callable from the main thread only. |
53 void AddInputHandler(int routing_id, | 55 void AddInputHandler(int routing_id, |
54 const base::WeakPtr<cc::InputHandler>& input_handler, | 56 const base::WeakPtr<cc::InputHandler>& input_handler, |
55 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 57 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
56 bool enable_smooth_scrolling, | 58 bool enable_smooth_scrolling, |
57 bool enable_wheel_gestures); | 59 bool enable_wheel_gestures); |
58 | 60 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 100 |
99 void NonBlockingInputEventHandledOnCompositorThread( | 101 void NonBlockingInputEventHandledOnCompositorThread( |
100 int routing_id, | 102 int routing_id, |
101 blink::WebInputEvent::Type); | 103 blink::WebInputEvent::Type); |
102 | 104 |
103 typedef base::ScopedPtrHashMap<int, // routing_id | 105 typedef base::ScopedPtrHashMap<int, // routing_id |
104 scoped_ptr<InputHandlerWrapper>> | 106 scoped_ptr<InputHandlerWrapper>> |
105 InputHandlerMap; | 107 InputHandlerMap; |
106 InputHandlerMap input_handlers_; | 108 InputHandlerMap input_handlers_; |
107 | 109 |
108 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 110 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
109 InputHandlerManagerClient* client_; | 111 InputHandlerManagerClient* const client_; |
110 scheduler::RendererScheduler* renderer_scheduler_; // Not owned. | 112 // May be null. |
| 113 SynchronousInputHandlerProxyClient* const synchronous_handler_proxy_client_; |
| 114 scheduler::RendererScheduler* const renderer_scheduler_; // Not owned. |
111 }; | 115 }; |
112 | 116 |
113 } // namespace content | 117 } // namespace content |
114 | 118 |
115 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 119 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
OLD | NEW |