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_WRAPPER_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ |
6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "content/renderer/input/input_handler_manager.h" | 9 #include "content/renderer/input/input_handler_manager.h" |
10 #include "content/renderer/input/input_handler_proxy.h" | 10 #include "content/renderer/input/input_handler_proxy.h" |
11 #include "content/renderer/input/input_handler_proxy_client.h" | 11 #include "content/renderer/input/input_handler_proxy_client.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 // This class lives on the compositor thread. | 15 // This class lives on the compositor thread. |
16 class InputHandlerWrapper : public InputHandlerProxyClient { | 16 class InputHandlerWrapper : public InputHandlerProxyClient { |
17 public: | 17 public: |
18 InputHandlerWrapper(InputHandlerManager* input_handler_manager, | 18 InputHandlerWrapper(InputHandlerManager* input_handler_manager, |
19 int routing_id, | 19 int routing_id, |
20 const scoped_refptr<base::MessageLoopProxy>& main_loop, | 20 const scoped_refptr<base::MessageLoopProxy>& main_loop, |
21 const base::WeakPtr<cc::InputHandler>& input_handler, | 21 const base::WeakPtr<cc::InputHandler>& input_handler, |
22 const base::WeakPtr<RenderViewImpl>& render_view_impl); | 22 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
| 23 RendererScheduler* renderer_scheduler); |
23 ~InputHandlerWrapper() override; | 24 ~InputHandlerWrapper() override; |
24 | 25 |
25 int routing_id() const { return routing_id_; } | 26 int routing_id() const { return routing_id_; } |
26 InputHandlerProxy* input_handler_proxy() { return &input_handler_proxy_; } | 27 InputHandlerProxy* input_handler_proxy() { return &input_handler_proxy_; } |
27 | 28 |
28 // InputHandlerProxyClient implementation. | 29 // InputHandlerProxyClient implementation. |
29 void WillShutdown() override; | 30 void WillShutdown() override; |
30 void TransferActiveWheelFlingAnimation( | 31 void TransferActiveWheelFlingAnimation( |
31 const blink::WebActiveWheelFlingParameters& params) override; | 32 const blink::WebActiveWheelFlingParameters& params) override; |
32 blink::WebGestureCurve* CreateFlingAnimationCurve( | 33 blink::WebGestureCurve* CreateFlingAnimationCurve( |
33 blink::WebGestureDevice deviceSource, | 34 blink::WebGestureDevice deviceSource, |
34 const blink::WebFloatPoint& velocity, | 35 const blink::WebFloatPoint& velocity, |
35 const blink::WebSize& cumulativeScroll) override; | 36 const blink::WebSize& cumulativeScroll) override; |
36 void DidOverscroll(const DidOverscrollParams& params) override; | 37 void DidOverscroll(const DidOverscrollParams& params) override; |
37 void DidStopFlinging() override; | 38 void DidStopFlinging() override; |
38 void DidReceiveInputEvent() override; | 39 void DidReceiveInputEvent() override; |
| 40 void DidAnimate() override; |
39 | 41 |
40 private: | 42 private: |
41 InputHandlerManager* input_handler_manager_; | 43 InputHandlerManager* input_handler_manager_; |
42 int routing_id_; | 44 int routing_id_; |
43 InputHandlerProxy input_handler_proxy_; | 45 InputHandlerProxy input_handler_proxy_; |
44 scoped_refptr<base::MessageLoopProxy> main_loop_; | 46 scoped_refptr<base::MessageLoopProxy> main_loop_; |
45 | 47 |
46 // Can only be accessed on the main thread. | 48 // Can only be accessed on the main thread. |
47 base::WeakPtr<RenderViewImpl> render_view_impl_; | 49 base::WeakPtr<RenderViewImpl> render_view_impl_; |
| 50 RendererScheduler* renderer_scheduler_; // Not owned. |
48 | 51 |
49 DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper); | 52 DISALLOW_COPY_AND_ASSIGN(InputHandlerWrapper); |
50 }; | 53 }; |
51 | 54 |
52 } // namespace content | 55 } // namespace content |
53 | 56 |
54 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ | 57 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_WRAPPER_H_ |
OLD | NEW |