OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GPU_INPUT_HANDLER_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_H_ |
6 #define CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_H_ | 6 #define CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "content/port/common/input_event_ack_state.h" |
11 #include "content/renderer/render_view_impl.h" | 12 #include "content/renderer/render_view_impl.h" |
12 #include "ipc/ipc_channel_proxy.h" | 13 #include "ipc/ipc_channel_proxy.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class MessageLoopProxy; | 16 class MessageLoopProxy; |
16 } | 17 } |
17 | 18 |
18 namespace cc { | 19 namespace cc { |
19 class InputHandler; | 20 class InputHandler; |
20 } | 21 } |
(...skipping 27 matching lines...) Expand all Loading... |
48 // Callable from the main thread only. | 49 // Callable from the main thread only. |
49 void AddInputHandler( | 50 void AddInputHandler( |
50 int routing_id, | 51 int routing_id, |
51 const base::WeakPtr<cc::InputHandler>& input_handler, | 52 const base::WeakPtr<cc::InputHandler>& input_handler, |
52 const base::WeakPtr<RenderViewImpl>& render_view_impl); | 53 const base::WeakPtr<RenderViewImpl>& render_view_impl); |
53 | 54 |
54 // Callback only from the compositor's thread. | 55 // Callback only from the compositor's thread. |
55 void RemoveInputHandler(int routing_id); | 56 void RemoveInputHandler(int routing_id); |
56 | 57 |
57 // Called from the compositor's thread. | 58 // Called from the compositor's thread. |
58 void HandleInputEvent(int routing_id, | 59 InputEventAckState HandleInputEvent(int routing_id, |
59 const WebKit::WebInputEvent* input_event); | 60 const WebKit::WebInputEvent* input_event); |
60 | 61 |
61 // Called from the compositor's thread. | 62 // Called from the compositor's thread. |
62 InputEventFilter* filter() { return filter_.get(); } | 63 InputEventFilter* filter() { return filter_.get(); } |
63 | 64 |
64 private: | 65 private: |
65 // Called from the compositor's thread. | 66 // Called from the compositor's thread. |
66 void AddInputHandlerOnCompositorThread( | 67 void AddInputHandlerOnCompositorThread( |
67 int routing_id, | 68 int routing_id, |
68 const scoped_refptr<base::MessageLoopProxy>& main_loop, | 69 const scoped_refptr<base::MessageLoopProxy>& main_loop, |
69 const base::WeakPtr<cc::InputHandler>& input_handler, | 70 const base::WeakPtr<cc::InputHandler>& input_handler, |
70 const base::WeakPtr<RenderViewImpl>& render_view_impl); | 71 const base::WeakPtr<RenderViewImpl>& render_view_impl); |
71 | 72 |
72 typedef std::map<int, // routing_id | 73 typedef std::map<int, // routing_id |
73 scoped_refptr<InputHandlerWrapper> > InputHandlerMap; | 74 scoped_refptr<InputHandlerWrapper> > InputHandlerMap; |
74 InputHandlerMap input_handlers_; | 75 InputHandlerMap input_handlers_; |
75 | 76 |
76 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | 77 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
77 scoped_refptr<InputEventFilter> filter_; | 78 scoped_refptr<InputEventFilter> filter_; |
78 }; | 79 }; |
79 | 80 |
80 } // namespace content | 81 } // namespace content |
81 | 82 |
82 #endif // CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_H_ | 83 #endif // CONTENT_RENDERER_GPU_INPUT_HANDLER_MANAGER_H_ |
OLD | NEW |