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 #include "content/renderer/input/input_handler_wrapper.h" | 5 #include "content/renderer/input/input_handler_wrapper.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "content/renderer/input/input_event_filter.h" | 8 #include "content/renderer/input/input_event_filter.h" |
9 #include "content/renderer/input/input_handler_manager.h" | 9 #include "content/renderer/input/input_handler_manager.h" |
10 #include "content/renderer/scheduler/renderer_scheduler.h" | |
10 #include "third_party/WebKit/public/platform/Platform.h" | 11 #include "third_party/WebKit/public/platform/Platform.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 InputHandlerWrapper::InputHandlerWrapper( | 15 InputHandlerWrapper::InputHandlerWrapper( |
15 InputHandlerManager* input_handler_manager, | 16 InputHandlerManager* input_handler_manager, |
16 int routing_id, | 17 int routing_id, |
17 const scoped_refptr<base::MessageLoopProxy>& main_loop, | 18 const scoped_refptr<base::MessageLoopProxy>& main_loop, |
18 const base::WeakPtr<cc::InputHandler>& input_handler, | 19 const base::WeakPtr<cc::InputHandler>& input_handler, |
19 const base::WeakPtr<RenderViewImpl>& render_view_impl) | 20 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
21 RendererScheduler* renderer_scheduler) | |
20 : input_handler_manager_(input_handler_manager), | 22 : input_handler_manager_(input_handler_manager), |
21 routing_id_(routing_id), | 23 routing_id_(routing_id), |
22 input_handler_proxy_(input_handler.get(), this), | 24 input_handler_proxy_(input_handler.get(), this), |
23 main_loop_(main_loop), | 25 main_loop_(main_loop), |
24 render_view_impl_(render_view_impl) { | 26 render_view_impl_(render_view_impl), |
27 renderer_scheduler_(renderer_scheduler) { | |
25 DCHECK(input_handler); | 28 DCHECK(input_handler); |
26 } | 29 } |
27 | 30 |
28 InputHandlerWrapper::~InputHandlerWrapper() { | 31 InputHandlerWrapper::~InputHandlerWrapper() { |
29 } | 32 } |
30 | 33 |
31 void InputHandlerWrapper::TransferActiveWheelFlingAnimation( | 34 void InputHandlerWrapper::TransferActiveWheelFlingAnimation( |
32 const blink::WebActiveWheelFlingParameters& params) { | 35 const blink::WebActiveWheelFlingParameters& params) { |
33 main_loop_->PostTask( | 36 main_loop_->PostTask( |
34 FROM_HERE, | 37 FROM_HERE, |
(...skipping 16 matching lines...) Expand all Loading... | |
51 | 54 |
52 void InputHandlerWrapper::DidOverscroll(const DidOverscrollParams& params) { | 55 void InputHandlerWrapper::DidOverscroll(const DidOverscrollParams& params) { |
53 input_handler_manager_->DidOverscroll(routing_id_, params); | 56 input_handler_manager_->DidOverscroll(routing_id_, params); |
54 } | 57 } |
55 | 58 |
56 void InputHandlerWrapper::DidStopFlinging() { | 59 void InputHandlerWrapper::DidStopFlinging() { |
57 input_handler_manager_->DidStopFlinging(routing_id_); | 60 input_handler_manager_->DidStopFlinging(routing_id_); |
58 } | 61 } |
59 | 62 |
60 void InputHandlerWrapper::DidReceiveInputEvent() { | 63 void InputHandlerWrapper::DidReceiveInputEvent() { |
61 // TODO(skyostil): Hook this up into the renderer scheduler. | 64 if (renderer_scheduler_) { |
Sami
2014/11/06 00:31:20
Instead of having renderer_scheduler_ as a member
alex clarke (OOO till 29th)
2014/11/06 19:21:45
Done.
| |
65 renderer_scheduler_->DidReceiveInputEvent(); | |
66 } | |
67 } | |
68 | |
69 void InputHandlerWrapper::DidAnimate() { | |
70 if (renderer_scheduler_) { | |
Sami
2014/11/06 00:31:20
The scheduler should never be null, right?
alex clarke (OOO till 29th)
2014/11/06 19:21:45
Acknowledged.
| |
71 renderer_scheduler_->DidAnimate(); | |
72 } | |
62 } | 73 } |
63 | 74 |
64 } // namespace content | 75 } // namespace content |
OLD | NEW |