OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/renderer/gpu/input_handler_wrapper.h" |
| 6 |
| 7 #include "content/renderer/gpu/input_event_filter.h" |
| 8 #include "content/renderer/gpu/input_handler_manager.h" |
| 9 #include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" |
| 10 |
| 11 namespace content { |
| 12 |
| 13 InputHandlerWrapper::InputHandlerWrapper( |
| 14 InputHandlerManager* input_handler_manager, |
| 15 int routing_id, |
| 16 const scoped_refptr<base::MessageLoopProxy>& main_loop, |
| 17 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 18 const base::WeakPtr<RenderViewImpl>& render_view_impl) |
| 19 : input_handler_manager_(input_handler_manager), |
| 20 routing_id_(routing_id), |
| 21 input_handler_proxy_(input_handler.get()), |
| 22 main_loop_(main_loop), |
| 23 render_view_impl_(render_view_impl) { |
| 24 input_handler_proxy_.SetClient(this); |
| 25 } |
| 26 |
| 27 InputHandlerWrapper::~InputHandlerWrapper() { |
| 28 input_handler_proxy_.SetClient(NULL); |
| 29 } |
| 30 |
| 31 void InputHandlerWrapper::TransferActiveWheelFlingAnimation( |
| 32 const WebKit::WebActiveWheelFlingParameters& params) { |
| 33 main_loop_->PostTask( |
| 34 FROM_HERE, |
| 35 base::Bind(&RenderViewImpl::TransferActiveWheelFlingAnimation, |
| 36 render_view_impl_, |
| 37 params)); |
| 38 } |
| 39 |
| 40 void InputHandlerWrapper::WillShutdown() { |
| 41 input_handler_manager_->RemoveInputHandler(routing_id_); |
| 42 } |
| 43 |
| 44 void InputHandlerWrapper::DidHandleInputEvent() { |
| 45 input_handler_manager_->filter()->DidHandleInputEvent(); |
| 46 } |
| 47 |
| 48 void InputHandlerWrapper::DidNotHandleInputEvent(bool send_to_widget) { |
| 49 input_handler_manager_->filter()->DidNotHandleInputEvent(send_to_widget); |
| 50 } |
| 51 |
| 52 WebKit::WebGestureCurve* InputHandlerWrapper::CreateFlingAnimationCurve( |
| 53 int deviceSource, |
| 54 const WebKit::WebFloatPoint& velocity, |
| 55 const WebKit::WebSize& cumulative_scroll) { |
| 56 return WebKit::Platform::current()->createFlingAnimationCurve( |
| 57 deviceSource, velocity, cumulative_scroll); |
| 58 } |
| 59 |
| 60 } // namespace content |
OLD | NEW |