| 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 27 matching lines...) Expand all Loading... |
| 38 // the underlying MessageLoop and supplied |client| must outlive this object. | 38 // the underlying MessageLoop and supplied |client| must outlive this object. |
| 39 InputHandlerManager( | 39 InputHandlerManager( |
| 40 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, | 40 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, |
| 41 InputHandlerManagerClient* client); | 41 InputHandlerManagerClient* client); |
| 42 ~InputHandlerManager(); | 42 ~InputHandlerManager(); |
| 43 | 43 |
| 44 // Callable from the main thread only. | 44 // Callable from the main thread only. |
| 45 void AddInputHandler(int routing_id, | 45 void AddInputHandler(int routing_id, |
| 46 const base::WeakPtr<cc::InputHandler>& input_handler, | 46 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 47 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 47 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
| 48 RendererScheduler* render_scheduler); | 48 RendererScheduler* renderer_scheduler); |
| 49 | 49 |
| 50 // Callback only from the compositor's thread. | 50 // Callback only from the compositor's thread. |
| 51 void RemoveInputHandler(int routing_id); | 51 void RemoveInputHandler(int routing_id); |
| 52 | 52 |
| 53 // Called from the compositor's thread. | 53 // Called from the compositor's thread. |
| 54 InputEventAckState HandleInputEvent(int routing_id, | 54 InputEventAckState HandleInputEvent(int routing_id, |
| 55 const blink::WebInputEvent* input_event, | 55 const blink::WebInputEvent* input_event, |
| 56 ui::LatencyInfo* latency_info); | 56 ui::LatencyInfo* latency_info); |
| 57 | 57 |
| 58 // Called from the compositor's thread. | 58 // Called from the compositor's thread. |
| 59 void DidOverscroll(int routing_id, const DidOverscrollParams& params); | 59 void DidOverscroll(int routing_id, const DidOverscrollParams& params); |
| 60 | 60 |
| 61 // Called from the compositor's thread. | 61 // Called from the compositor's thread. |
| 62 void DidStopFlinging(int routing_id); | 62 void DidStopFlinging(int routing_id); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // Called from the compositor's thread. | 65 // Called from the compositor's thread. |
| 66 void AddInputHandlerOnCompositorThread( | 66 void AddInputHandlerOnCompositorThread( |
| 67 int routing_id, | 67 int routing_id, |
| 68 const scoped_refptr<base::MessageLoopProxy>& main_loop, | 68 const scoped_refptr<base::MessageLoopProxy>& main_loop, |
| 69 const base::WeakPtr<cc::InputHandler>& input_handler, | 69 const base::WeakPtr<cc::InputHandler>& input_handler, |
| 70 const base::WeakPtr<RenderViewImpl>& render_view_impl, | 70 const base::WeakPtr<RenderViewImpl>& render_view_impl, |
| 71 RendererScheduler* render_scheduler); | 71 RendererScheduler* renderer_scheduler); |
| 72 | 72 |
| 73 typedef base::ScopedPtrHashMap<int, // routing_id | 73 typedef base::ScopedPtrHashMap<int, // routing_id |
| 74 InputHandlerWrapper> InputHandlerMap; | 74 InputHandlerWrapper> InputHandlerMap; |
| 75 InputHandlerMap input_handlers_; | 75 InputHandlerMap input_handlers_; |
| 76 | 76 |
| 77 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 77 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| 78 InputHandlerManagerClient* client_; | 78 InputHandlerManagerClient* client_; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 } // namespace content | 81 } // namespace content |
| 82 | 82 |
| 83 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ | 83 #endif // CONTENT_RENDERER_INPUT_INPUT_HANDLER_MANAGER_H_ |
| OLD | NEW |