| 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_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/event_with_latency_info.h" | 8 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/common/input/input_event_ack_source.h" |
| 10 #include "content/common/input/input_event_ack_state.h" | 11 #include "content/common/input/input_event_ack_state.h" |
| 11 #include "content/public/browser/native_web_keyboard_event.h" | 12 #include "content/public/browser/native_web_keyboard_event.h" |
| 12 #include "third_party/WebKit/public/web/WebInputEvent.h" | 13 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 13 | 14 |
| 14 namespace ui { | 15 namespace ui { |
| 15 class LatencyInfo; | 16 class LatencyInfo; |
| 16 struct DidOverscrollParams; | 17 struct DidOverscrollParams; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 21 class CONTENT_EXPORT InputRouterClient { | 22 class CONTENT_EXPORT InputRouterClient { |
| 22 public: | 23 public: |
| 23 virtual ~InputRouterClient() {} | 24 virtual ~InputRouterClient() {} |
| 24 | 25 |
| 25 // Called just prior to events being sent to the renderer, giving the client | 26 // Called just prior to events being sent to the renderer, giving the client |
| 26 // a chance to perform in-process event filtering. | 27 // a chance to perform in-process event filtering. |
| 27 // The returned disposition will yield the following behavior: | 28 // The returned disposition will yield the following behavior: |
| 28 // * |NOT_CONSUMED| will result in |input_event| being sent as usual. | 29 // * |NOT_CONSUMED| will result in |input_event| being sent as usual. |
| 29 // * |CONSUMED| or |NO_CONSUMER_EXISTS| will trigger the appropriate ack. | 30 // * |CONSUMED| or |NO_CONSUMER_EXISTS| will trigger the appropriate ack. |
| 30 // * |UNKNOWN| will result in |input_event| being dropped. | 31 // * |UNKNOWN| will result in |input_event| being dropped. |
| 31 virtual InputEventAckState FilterInputEvent( | 32 virtual InputEventAckState FilterInputEvent( |
| 32 const blink::WebInputEvent& input_event, | 33 const blink::WebInputEvent& input_event, |
| 33 const ui::LatencyInfo& latency_info) = 0; | 34 const ui::LatencyInfo& latency_info) = 0; |
| 34 | 35 |
| 35 // Called each time a WebInputEvent IPC is sent. | 36 // Called each time a WebInputEvent IPC is sent. |
| 36 virtual void IncrementInFlightEventCount(blink::WebInputEvent::Type type) = 0; | 37 virtual void IncrementInFlightEventCount(blink::WebInputEvent::Type type) = 0; |
| 37 | 38 |
| 38 // Called each time a WebInputEvent ACK IPC is received. | 39 // Called each time a WebInputEvent ACK IPC is received. |
| 39 virtual void DecrementInFlightEventCount() = 0; | 40 virtual void DecrementInFlightEventCount(InputEventAckSource ack_source) = 0; |
| 40 | 41 |
| 41 // Called when the renderer notifies that it has touch event handlers. | 42 // Called when the renderer notifies that it has touch event handlers. |
| 42 virtual void OnHasTouchEventHandlers(bool has_handlers) = 0; | 43 virtual void OnHasTouchEventHandlers(bool has_handlers) = 0; |
| 43 | 44 |
| 44 // Called when the router has finished flushing all events queued at the time | 45 // Called when the router has finished flushing all events queued at the time |
| 45 // of the call to Flush. The call will typically be asynchronous with | 46 // of the call to Flush. The call will typically be asynchronous with |
| 46 // respect to the call to |Flush| on the InputRouter. | 47 // respect to the call to |Flush| on the InputRouter. |
| 47 virtual void DidFlush() = 0; | 48 virtual void DidFlush() = 0; |
| 48 | 49 |
| 49 // Called when the router has received an overscroll notification from the | 50 // Called when the router has received an overscroll notification from the |
| 50 // renderer. | 51 // renderer. |
| 51 virtual void DidOverscroll(const ui::DidOverscrollParams& params) = 0; | 52 virtual void DidOverscroll(const ui::DidOverscrollParams& params) = 0; |
| 52 | 53 |
| 53 // Called when a renderer fling has terminated. | 54 // Called when a renderer fling has terminated. |
| 54 virtual void DidStopFlinging() = 0; | 55 virtual void DidStopFlinging() = 0; |
| 55 | 56 |
| 56 // Called when the input router generates an event. It is intended that the | 57 // Called when the input router generates an event. It is intended that the |
| 57 // client will do some processing on |gesture_event| and then send it back | 58 // client will do some processing on |gesture_event| and then send it back |
| 58 // to the InputRouter via SendGestureEvent. | 59 // to the InputRouter via SendGestureEvent. |
| 59 virtual void ForwardGestureEventWithLatencyInfo( | 60 virtual void ForwardGestureEventWithLatencyInfo( |
| 60 const blink::WebGestureEvent& gesture_event, | 61 const blink::WebGestureEvent& gesture_event, |
| 61 const ui::LatencyInfo& latency_info) = 0; | 62 const ui::LatencyInfo& latency_info) = 0; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace content | 65 } // namespace content |
| 65 | 66 |
| 66 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ | 67 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_CLIENT_H_ |
| OLD | NEW |