| 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 #include "content/common/input/input_event.h" |
| 11 | 12 |
| 12 namespace content { | 13 namespace content { |
| 13 | 14 |
| 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, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 bool has_touch_handler() const { return has_touch_handler_; } | 41 bool has_touch_handler() const { return has_touch_handler_; } |
| 42 void set_filter_state(InputEventAckState filter_state) { | 42 void set_filter_state(InputEventAckState filter_state) { |
| 43 filter_state_ = filter_state; | 43 filter_state_ = filter_state; |
| 44 } | 44 } |
| 45 int in_flight_event_count() const { | 45 int in_flight_event_count() const { |
| 46 return in_flight_event_count_; | 46 return in_flight_event_count_; |
| 47 } | 47 } |
| 48 void set_allow_send_event(bool allow) { | 48 void set_allow_send_event(bool allow) { |
| 49 filter_state_ = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 49 filter_state_ = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 50 } | 50 } |
| 51 const blink::WebInputEvent* last_filter_event() const { |
| 52 return last_filter_event_->web_event.get(); |
| 53 } |
| 51 | 54 |
| 52 private: | 55 private: |
| 53 InputRouter* input_router_; | 56 InputRouter* input_router_; |
| 54 int in_flight_event_count_; | 57 int in_flight_event_count_; |
| 55 bool has_touch_handler_; | 58 bool has_touch_handler_; |
| 56 | 59 |
| 57 InputEventAckState filter_state_; | 60 InputEventAckState filter_state_; |
| 58 | 61 |
| 59 bool filter_input_event_called_; | 62 bool filter_input_event_called_; |
| 60 scoped_ptr<InputEvent> last_filter_event_; | 63 scoped_ptr<InputEvent> last_filter_event_; |
| 61 | 64 |
| 62 size_t did_flush_called_count_; | 65 size_t did_flush_called_count_; |
| 63 | 66 |
| 64 DidOverscrollParams overscroll_; | 67 DidOverscrollParams overscroll_; |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace content | 70 } // namespace content |
| 68 | 71 |
| 69 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ | 72 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOCK_INPUT_ROUTER_CLIENT_H_ |
| OLD | NEW |