| 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_MOCK_INPUT_ROUTER_CLIENT_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 void IncrementInFlightEventCount( | 29 void IncrementInFlightEventCount( |
| 30 blink::WebInputEvent::Type event_type) override; | 30 blink::WebInputEvent::Type event_type) override; |
| 31 void DecrementInFlightEventCount(InputEventAckSource ack_source) override; | 31 void DecrementInFlightEventCount(InputEventAckSource ack_source) override; |
| 32 void OnHasTouchEventHandlers(bool has_handlers) override; | 32 void OnHasTouchEventHandlers(bool has_handlers) override; |
| 33 void DidFlush() override; | 33 void DidFlush() override; |
| 34 void DidOverscroll(const ui::DidOverscrollParams& params) override; | 34 void DidOverscroll(const ui::DidOverscrollParams& params) override; |
| 35 void DidStopFlinging() override; | 35 void DidStopFlinging() override; |
| 36 void ForwardGestureEventWithLatencyInfo( | 36 void ForwardGestureEventWithLatencyInfo( |
| 37 const blink::WebGestureEvent& gesture_event, | 37 const blink::WebGestureEvent& gesture_event, |
| 38 const ui::LatencyInfo& latency_info) override; | 38 const ui::LatencyInfo& latency_info) override; |
| 39 bool IsInGestureScroll(blink::WebGestureDevice device) const override; |
| 39 | 40 |
| 40 bool GetAndResetFilterEventCalled(); | 41 bool GetAndResetFilterEventCalled(); |
| 41 size_t GetAndResetDidFlushCount(); | 42 size_t GetAndResetDidFlushCount(); |
| 42 ui::DidOverscrollParams GetAndResetOverscroll(); | 43 ui::DidOverscrollParams GetAndResetOverscroll(); |
| 43 | 44 |
| 44 void set_input_router(InputRouter* input_router) { | 45 void set_input_router(InputRouter* input_router) { |
| 45 input_router_ = input_router; | 46 input_router_ = input_router; |
| 46 } | 47 } |
| 47 | 48 |
| 48 bool has_touch_handler() const { return has_touch_handler_; } | 49 bool has_touch_handler() const { return has_touch_handler_; } |
| 49 void set_filter_state(InputEventAckState filter_state) { | 50 void set_filter_state(InputEventAckState filter_state) { |
| 50 filter_state_ = filter_state; | 51 filter_state_ = filter_state; |
| 51 } | 52 } |
| 52 int in_flight_event_count() const { | 53 int in_flight_event_count() const { |
| 53 return in_flight_event_count_; | 54 return in_flight_event_count_; |
| 54 } | 55 } |
| 55 void set_allow_send_event(bool allow) { | 56 void set_allow_send_event(bool allow) { |
| 56 filter_state_ = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 57 filter_state_ = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 57 } | 58 } |
| 58 const blink::WebInputEvent* last_filter_event() const { | 59 const blink::WebInputEvent* last_filter_event() const { |
| 59 return last_filter_event_->web_event.get(); | 60 return last_filter_event_->web_event.get(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 private: | 63 private: |
| 63 InputRouter* input_router_; | 64 InputRouter* input_router_; |
| 64 int in_flight_event_count_; | 65 int in_flight_event_count_; |
| 65 bool has_touch_handler_; | 66 bool has_touch_handler_; |
| 67 bool is_in_gesture_scroll_; |
| 66 | 68 |
| 67 InputEventAckState filter_state_; | 69 InputEventAckState filter_state_; |
| 68 | 70 |
| 69 bool filter_input_event_called_; | 71 bool filter_input_event_called_; |
| 70 std::unique_ptr<InputEvent> last_filter_event_; | 72 std::unique_ptr<InputEvent> last_filter_event_; |
| 71 | 73 |
| 72 size_t did_flush_called_count_; | 74 size_t did_flush_called_count_; |
| 73 | 75 |
| 74 ui::DidOverscrollParams overscroll_; | 76 ui::DidOverscrollParams overscroll_; |
| 75 }; | 77 }; |
| 76 | 78 |
| 77 } // namespace content | 79 } // namespace content |
| 78 | 80 |
| 79 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ | 81 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ |
| OLD | NEW |