| 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> |
| 11 | 11 |
| 12 #include "content/browser/renderer_host/input/input_router_client.h" | 12 #include "content/browser/renderer_host/input/input_router_client.h" |
| 13 #include "content/common/input/did_overscroll_params.h" | |
| 14 #include "content/common/input/input_event.h" | 13 #include "content/common/input/input_event.h" |
| 14 #include "ui/events/blink/did_overscroll_params.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class InputRouter; | 18 class InputRouter; |
| 19 | 19 |
| 20 class MockInputRouterClient : public InputRouterClient { | 20 class MockInputRouterClient : public InputRouterClient { |
| 21 public: | 21 public: |
| 22 MockInputRouterClient(); | 22 MockInputRouterClient(); |
| 23 ~MockInputRouterClient() override; | 23 ~MockInputRouterClient() override; |
| 24 | 24 |
| 25 // InputRouterClient | 25 // InputRouterClient |
| 26 InputEventAckState FilterInputEvent( | 26 InputEventAckState FilterInputEvent( |
| 27 const blink::WebInputEvent& input_event, | 27 const blink::WebInputEvent& input_event, |
| 28 const ui::LatencyInfo& latency_info) override; | 28 const ui::LatencyInfo& latency_info) override; |
| 29 void IncrementInFlightEventCount() override; | 29 void IncrementInFlightEventCount() override; |
| 30 void DecrementInFlightEventCount() override; | 30 void DecrementInFlightEventCount() override; |
| 31 void OnHasTouchEventHandlers(bool has_handlers) override; | 31 void OnHasTouchEventHandlers(bool has_handlers) override; |
| 32 void DidFlush() override; | 32 void DidFlush() override; |
| 33 void DidOverscroll(const DidOverscrollParams& params) override; | 33 void DidOverscroll(const ui::DidOverscrollParams& params) override; |
| 34 void DidStopFlinging() override; | 34 void DidStopFlinging() override; |
| 35 void ForwardGestureEventWithLatencyInfo( | 35 void ForwardGestureEventWithLatencyInfo( |
| 36 const blink::WebGestureEvent& gesture_event, | 36 const blink::WebGestureEvent& gesture_event, |
| 37 const ui::LatencyInfo& latency_info) override; | 37 const ui::LatencyInfo& latency_info) override; |
| 38 | 38 |
| 39 bool GetAndResetFilterEventCalled(); | 39 bool GetAndResetFilterEventCalled(); |
| 40 size_t GetAndResetDidFlushCount(); | 40 size_t GetAndResetDidFlushCount(); |
| 41 DidOverscrollParams GetAndResetOverscroll(); | 41 ui::DidOverscrollParams GetAndResetOverscroll(); |
| 42 | 42 |
| 43 void set_input_router(InputRouter* input_router) { | 43 void set_input_router(InputRouter* input_router) { |
| 44 input_router_ = input_router; | 44 input_router_ = input_router; |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool has_touch_handler() const { return has_touch_handler_; } | 47 bool has_touch_handler() const { return has_touch_handler_; } |
| 48 void set_filter_state(InputEventAckState filter_state) { | 48 void set_filter_state(InputEventAckState filter_state) { |
| 49 filter_state_ = filter_state; | 49 filter_state_ = filter_state; |
| 50 } | 50 } |
| 51 int in_flight_event_count() const { | 51 int in_flight_event_count() const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 63 int in_flight_event_count_; | 63 int in_flight_event_count_; |
| 64 bool has_touch_handler_; | 64 bool has_touch_handler_; |
| 65 | 65 |
| 66 InputEventAckState filter_state_; | 66 InputEventAckState filter_state_; |
| 67 | 67 |
| 68 bool filter_input_event_called_; | 68 bool filter_input_event_called_; |
| 69 std::unique_ptr<InputEvent> last_filter_event_; | 69 std::unique_ptr<InputEvent> last_filter_event_; |
| 70 | 70 |
| 71 size_t did_flush_called_count_; | 71 size_t did_flush_called_count_; |
| 72 | 72 |
| 73 DidOverscrollParams overscroll_; | 73 ui::DidOverscrollParams overscroll_; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| 77 | 77 |
| 78 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ | 78 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ |
| OLD | NEW |