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 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // The |handler| is invoked on the thread associated with |target_loop| to | 47 // The |handler| is invoked on the thread associated with |target_loop| to |
48 // handle input events matching the filtered routes. | 48 // handle input events matching the filtered routes. |
49 // | 49 // |
50 // If INPUT_EVENT_ACK_STATE_NOT_CONSUMED is returned by the handler, | 50 // If INPUT_EVENT_ACK_STATE_NOT_CONSUMED is returned by the handler, |
51 // the original InputMsg_HandleInputEvent message will be delivered to | 51 // the original InputMsg_HandleInputEvent message will be delivered to |
52 // |main_listener| on the main thread. (The "main thread" in this context is | 52 // |main_listener| on the main thread. (The "main thread" in this context is |
53 // the thread where the InputEventFilter was constructed.) The responsibility | 53 // the thread where the InputEventFilter was constructed.) The responsibility |
54 // is left to the eventual handler to deliver the corresponding | 54 // is left to the eventual handler to deliver the corresponding |
55 // InputHostMsg_HandleInputEvent_ACK. | 55 // InputHostMsg_HandleInputEvent_ACK. |
56 // | 56 // |
57 virtual void SetBoundHandler(const Handler& handler) OVERRIDE; | 57 virtual void SetBoundHandler(const Handler& handler) override; |
58 virtual void DidAddInputHandler(int routing_id, | 58 virtual void DidAddInputHandler(int routing_id, |
59 cc::InputHandler* input_handler) OVERRIDE; | 59 cc::InputHandler* input_handler) override; |
60 virtual void DidRemoveInputHandler(int routing_id) OVERRIDE; | 60 virtual void DidRemoveInputHandler(int routing_id) override; |
61 virtual void DidOverscroll(int routing_id, | 61 virtual void DidOverscroll(int routing_id, |
62 const DidOverscrollParams& params) OVERRIDE; | 62 const DidOverscrollParams& params) override; |
63 virtual void DidStopFlinging(int routing_id) OVERRIDE; | 63 virtual void DidStopFlinging(int routing_id) override; |
64 | 64 |
65 // IPC::MessageFilter methods: | 65 // IPC::MessageFilter methods: |
66 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; | 66 virtual void OnFilterAdded(IPC::Sender* sender) override; |
67 virtual void OnFilterRemoved() OVERRIDE; | 67 virtual void OnFilterRemoved() override; |
68 virtual void OnChannelClosing() OVERRIDE; | 68 virtual void OnChannelClosing() override; |
69 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 69 virtual bool OnMessageReceived(const IPC::Message& message) override; |
70 | 70 |
71 private: | 71 private: |
72 virtual ~InputEventFilter(); | 72 virtual ~InputEventFilter(); |
73 | 73 |
74 void ForwardToMainListener(const IPC::Message& message); | 74 void ForwardToMainListener(const IPC::Message& message); |
75 void ForwardToHandler(const IPC::Message& message); | 75 void ForwardToHandler(const IPC::Message& message); |
76 void SendMessage(scoped_ptr<IPC::Message> message); | 76 void SendMessage(scoped_ptr<IPC::Message> message); |
77 void SendMessageOnIOThread(scoped_ptr<IPC::Message> message); | 77 void SendMessageOnIOThread(scoped_ptr<IPC::Message> message); |
78 | 78 |
79 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 79 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
(...skipping 19 matching lines...) Expand all Loading... |
99 // Used to intercept overscroll notifications while an event is being | 99 // Used to intercept overscroll notifications while an event is being |
100 // dispatched. If the event causes overscroll, the overscroll metadata can be | 100 // dispatched. If the event causes overscroll, the overscroll metadata can be |
101 // bundled in the event ack, saving an IPC. Note that we must continue | 101 // bundled in the event ack, saving an IPC. Note that we must continue |
102 // supporting overscroll IPC notifications due to fling animation updates. | 102 // supporting overscroll IPC notifications due to fling animation updates. |
103 scoped_ptr<DidOverscrollParams>* current_overscroll_params_; | 103 scoped_ptr<DidOverscrollParams>* current_overscroll_params_; |
104 }; | 104 }; |
105 | 105 |
106 } // namespace content | 106 } // namespace content |
107 | 107 |
108 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ | 108 #endif // CONTENT_RENDERER_INPUT_INPUT_EVENT_FILTER_H_ |
OLD | NEW |