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_EVENT_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
6 #define CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 6 #define CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <unordered_map> | 10 #include <unordered_map> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // |main_listener| on the main thread. (The "main thread" in this context is | 58 // |main_listener| on the main thread. (The "main thread" in this context is |
59 // the thread where the InputEventFilter was constructed.) The responsibility | 59 // the thread where the InputEventFilter was constructed.) The responsibility |
60 // is left to the eventual handler to deliver the corresponding | 60 // is left to the eventual handler to deliver the corresponding |
61 // InputHostMsg_HandleInputEvent_ACK. | 61 // InputHostMsg_HandleInputEvent_ACK. |
62 // | 62 // |
63 void SetBoundHandler(const Handler& handler) override; | 63 void SetBoundHandler(const Handler& handler) override; |
64 void DidAddInputHandler(int routing_id) override; | 64 void DidAddInputHandler(int routing_id) override; |
65 void DidRemoveInputHandler(int routing_id) override; | 65 void DidRemoveInputHandler(int routing_id) override; |
66 void DidOverscroll(int routing_id, | 66 void DidOverscroll(int routing_id, |
67 const DidOverscrollParams& params) override; | 67 const DidOverscrollParams& params) override; |
| 68 void DidStartFlinging(int routing_id) override; |
68 void DidStopFlinging(int routing_id) override; | 69 void DidStopFlinging(int routing_id) override; |
69 void NotifyInputEventHandled(int routing_id, | 70 void NotifyInputEventHandled(int routing_id, |
70 blink::WebInputEvent::Type type) override; | 71 blink::WebInputEvent::Type type) override; |
71 | 72 |
72 // IPC::MessageFilter methods: | 73 // IPC::MessageFilter methods: |
73 void OnFilterAdded(IPC::Sender* sender) override; | 74 void OnFilterAdded(IPC::Sender* sender) override; |
74 void OnFilterRemoved() override; | 75 void OnFilterRemoved() override; |
75 void OnChannelClosing() override; | 76 void OnChannelClosing() override; |
76 bool OnMessageReceived(const IPC::Message& message) override; | 77 bool OnMessageReceived(const IPC::Message& message) override; |
77 | 78 |
78 // MainThreadEventQueueClient methods: | 79 // MainThreadEventQueueClient methods: |
79 void SendEventToMainThread(int routing_id, | 80 void SendEventToMainThread(int routing_id, |
80 const blink::WebInputEvent* event, | 81 const blink::WebInputEvent* event, |
81 const ui::LatencyInfo& latency, | 82 const ui::LatencyInfo& latency, |
82 InputEventDispatchType dispatch_type) override; | 83 InputEventDispatchType dispatch_type) override; |
83 | 84 |
84 private: | 85 private: |
85 ~InputEventFilter() override; | 86 ~InputEventFilter() override; |
86 | 87 |
87 void ForwardToHandler(const IPC::Message& message); | 88 void ForwardToHandler(const IPC::Message& message); |
88 void SendMessage(std::unique_ptr<IPC::Message> message); | 89 void SendMessage(std::unique_ptr<IPC::Message> message); |
89 void SendMessageOnIOThread(std::unique_ptr<IPC::Message> message); | 90 void SendMessageOnIOThread(std::unique_ptr<IPC::Message> message); |
| 91 void SetIsFlingingInMainThreadEventQueue(int routing_id, bool is_flinging); |
90 | 92 |
91 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 93 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
92 base::Callback<void(const IPC::Message&)> main_listener_; | 94 base::Callback<void(const IPC::Message&)> main_listener_; |
93 | 95 |
94 // The sender_ only gets invoked on the thread corresponding to io_loop_. | 96 // The sender_ only gets invoked on the thread corresponding to io_loop_. |
95 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 97 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
96 IPC::Sender* sender_; | 98 IPC::Sender* sender_; |
97 | 99 |
98 // The handler_ only gets Run on the thread corresponding to target_loop_. | 100 // The handler_ only gets Run on the thread corresponding to target_loop_. |
99 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; | 101 scoped_refptr<base::SingleThreadTaskRunner> target_task_runner_; |
(...skipping 12 matching lines...) Expand all Loading... |
112 // Used to intercept overscroll notifications while an event is being | 114 // Used to intercept overscroll notifications while an event is being |
113 // dispatched. If the event causes overscroll, the overscroll metadata can be | 115 // dispatched. If the event causes overscroll, the overscroll metadata can be |
114 // bundled in the event ack, saving an IPC. Note that we must continue | 116 // bundled in the event ack, saving an IPC. Note that we must continue |
115 // supporting overscroll IPC notifications due to fling animation updates. | 117 // supporting overscroll IPC notifications due to fling animation updates. |
116 std::unique_ptr<DidOverscrollParams>* current_overscroll_params_; | 118 std::unique_ptr<DidOverscrollParams>* current_overscroll_params_; |
117 }; | 119 }; |
118 | 120 |
119 } // namespace content | 121 } // namespace content |
120 | 122 |
121 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 123 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
OLD | NEW |