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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/browser/renderer_host/input/input_router_client.h" | 9 #include "content/browser/renderer_host/input/input_router_client.h" |
10 #include "content/common/input/did_overscroll_params.h" | 10 #include "content/common/input/did_overscroll_params.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class InputEvent; | 14 class InputEvent; |
15 class InputRouter; | 15 class InputRouter; |
16 | 16 |
17 class MockInputRouterClient : public InputRouterClient { | 17 class MockInputRouterClient : public InputRouterClient { |
18 public: | 18 public: |
19 MockInputRouterClient(); | 19 MockInputRouterClient(); |
20 ~MockInputRouterClient() override; | 20 ~MockInputRouterClient() override; |
21 | 21 |
22 // InputRouterClient | 22 // InputRouterClient |
23 InputEventAckState FilterInputEvent( | 23 InputEventAckState FilterInputEvent( |
24 const blink::WebInputEvent& input_event, | 24 const blink::WebInputEvent& input_event, |
25 const ui::LatencyInfo& latency_info) override; | 25 const ui::LatencyInfo& latency_info) override; |
26 void IncrementInFlightEventCount() override; | 26 void IncrementInFlightEventCount() override; |
27 void DecrementInFlightEventCount() override; | 27 void DecrementInFlightEventCount() override; |
28 void OnHasTouchEventHandlers(bool has_handlers) override; | 28 void OnHasTouchEventHandlers(bool has_handlers) override; |
29 void SetNeedsFlush() override; | |
30 void DidFlush() override; | 29 void DidFlush() override; |
31 void DidOverscroll(const DidOverscrollParams& params) override; | 30 void DidOverscroll(const DidOverscrollParams& params) override; |
| 31 void DidStopFlinging() override; |
32 | 32 |
33 bool GetAndResetFilterEventCalled(); | 33 bool GetAndResetFilterEventCalled(); |
34 size_t GetAndResetDidFlushCount(); | 34 size_t GetAndResetDidFlushCount(); |
35 DidOverscrollParams GetAndResetOverscroll(); | 35 DidOverscrollParams GetAndResetOverscroll(); |
36 | 36 |
37 void set_input_router(InputRouter* input_router) { | 37 void set_input_router(InputRouter* input_router) { |
38 input_router_ = input_router; | 38 input_router_ = input_router; |
39 } | 39 } |
40 | 40 |
41 bool has_touch_handler() const { return has_touch_handler_; } | 41 bool has_touch_handler() const { return has_touch_handler_; } |
(...skipping 11 matching lines...) Expand all Loading... |
53 InputRouter* input_router_; | 53 InputRouter* input_router_; |
54 int in_flight_event_count_; | 54 int in_flight_event_count_; |
55 bool has_touch_handler_; | 55 bool has_touch_handler_; |
56 | 56 |
57 InputEventAckState filter_state_; | 57 InputEventAckState filter_state_; |
58 | 58 |
59 bool filter_input_event_called_; | 59 bool filter_input_event_called_; |
60 scoped_ptr<InputEvent> last_filter_event_; | 60 scoped_ptr<InputEvent> last_filter_event_; |
61 | 61 |
62 size_t did_flush_called_count_; | 62 size_t did_flush_called_count_; |
63 bool set_needs_flush_called_; | |
64 | 63 |
65 DidOverscrollParams overscroll_; | 64 DidOverscrollParams overscroll_; |
66 }; | 65 }; |
67 | 66 |
68 } // namespace content | 67 } // namespace content |
69 | 68 |
70 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ | 69 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ |
OLD | NEW |