| 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 29 matching lines...) Expand all Loading... |
| 40 class InputHandlerManager { | 40 class InputHandlerManager { |
| 41 public: | 41 public: |
| 42 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The | 42 // |task_runner| is the SingleThreadTaskRunner of the compositor thread. The |
| 43 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| | 43 // underlying MessageLoop and supplied |client| and the |renderer_scheduler| |
| 44 // must outlive this object. The RendererScheduler needs to know when input | 44 // 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. | 45 // events and fling animations occur, which is why it's passed in here. |
| 46 InputHandlerManager( | 46 InputHandlerManager( |
| 47 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 47 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
| 48 InputHandlerManagerClient* client, | 48 InputHandlerManagerClient* client, |
| 49 scheduler::RendererScheduler* renderer_scheduler); | 49 scheduler::RendererScheduler* renderer_scheduler); |
| 50 ~InputHandlerManager(); | 50 virtual ~InputHandlerManager(); |
| 51 | 51 |
| 52 // Callable from the main thread only. | 52 // Callable from the main thread only. |
| 53 void AddInputHandler(int routing_id, | 53 void AddInputHandler(int routing_id, |
| 54 const base::WeakPtr<cc::InputHandler>& input_handler, | 54 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 55 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 55 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
| 56 bool enable_smooth_scrolling, | 56 bool enable_smooth_scrolling, |
| 57 bool enable_wheel_gestures); | 57 bool enable_wheel_gestures); |
| 58 | 58 |
| 59 void ObserveWheelEventAndResultOnMainThread( | 59 void ObserveWheelEventAndResultOnMainThread( |
| 60 int routing_id, | 60 int routing_id, |
| 61 const blink::WebMouseWheelEvent& wheel_event, | 61 const blink::WebMouseWheelEvent& wheel_event, |
| 62 const cc::InputHandlerScrollResult& scroll_result); | 62 const cc::InputHandlerScrollResult& scroll_result); |
| 63 | 63 |
| 64 void NonBlockingInputEventHandledOnMainThread(int routing_id, | 64 void NonBlockingInputEventHandledOnMainThread(int routing_id, |
| 65 blink::WebInputEvent::Type); | 65 blink::WebInputEvent::Type); |
| 66 | 66 |
| 67 // Callback only from the compositor's thread. | 67 // Callback only from the compositor's thread. |
| 68 void RemoveInputHandler(int routing_id); | 68 void RemoveInputHandler(int routing_id); |
| 69 | 69 |
| 70 // Called from the compositor's thread. | 70 // Called from the compositor's thread. |
| 71 InputEventAckState HandleInputEvent(int routing_id, | 71 virtual InputEventAckState HandleInputEvent( |
| 72 const blink::WebInputEvent* input_event, | 72 int routing_id, |
| 73 ui::LatencyInfo* latency_info); | 73 const blink::WebInputEvent* input_event, |
| 74 ui::LatencyInfo* latency_info); |
| 74 | 75 |
| 75 // Called from the compositor's thread. | 76 // Called from the compositor's thread. |
| 76 void DidOverscroll(int routing_id, const DidOverscrollParams& params); | 77 void DidOverscroll(int routing_id, const DidOverscrollParams& params); |
| 77 | 78 |
| 78 // Called from the compositor's thread. | 79 // Called from the compositor's thread. |
| 79 void DidStopFlinging(int routing_id); | 80 void DidStopFlinging(int routing_id); |
| 80 | 81 |
| 81 // Called from the compositor's thread. | 82 // Called from the compositor's thread. |
| 82 void DidAnimateForInput(); | 83 void DidAnimateForInput(); |
| 83 | 84 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 106 InputHandlerMap input_handlers_; | 107 InputHandlerMap input_handlers_; |
| 107 | 108 |
| 108 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 109 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 109 InputHandlerManagerClient* client_; | 110 InputHandlerManagerClient* client_; |
| 110 scheduler::RendererScheduler* renderer_scheduler_; // Not owned. | 111 scheduler::RendererScheduler* renderer_scheduler_; // Not owned. |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 } // namespace content | 114 } // namespace content |
| 114 | 115 |
| 115 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 116 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
| OLD | NEW |