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 #include "content/browser/renderer_host/input/mock_input_router_client.h" | 5 #include "content/browser/renderer_host/input/mock_input_router_client.h" |
6 | 6 |
7 #include "content/browser/renderer_host/input/input_router.h" | 7 #include "content/browser/renderer_host/input/input_router.h" |
8 #include "content/common/input/input_event.h" | 8 #include "content/common/input/input_event.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 void MockInputRouterClient::DecrementInFlightEventCount() { | 44 void MockInputRouterClient::DecrementInFlightEventCount() { |
45 --in_flight_event_count_; | 45 --in_flight_event_count_; |
46 } | 46 } |
47 | 47 |
48 void MockInputRouterClient::OnHasTouchEventHandlers( | 48 void MockInputRouterClient::OnHasTouchEventHandlers( |
49 bool has_handlers) { | 49 bool has_handlers) { |
50 has_touch_handler_ = has_handlers; | 50 has_touch_handler_ = has_handlers; |
51 } | 51 } |
52 | 52 |
53 OverscrollController* MockInputRouterClient::GetOverscrollController() const { | 53 void MockInputRouterClient::SetNeedsFlush() { |
54 return NULL; | 54 set_needs_flush_called_ = true; |
55 } | 55 } |
56 | 56 |
57 void MockInputRouterClient::DidFlush() { | 57 void MockInputRouterClient::DidFlush() { |
58 ++did_flush_called_count_; | 58 ++did_flush_called_count_; |
59 } | 59 } |
60 | 60 |
61 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { | 61 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { |
62 overscroll_ = params; | 62 overscroll_ = params; |
63 } | 63 } |
64 | 64 |
65 void MockInputRouterClient::SetNeedsFlush() { | |
66 set_needs_flush_called_ = true; | |
67 } | |
68 | |
69 bool MockInputRouterClient::GetAndResetFilterEventCalled() { | 65 bool MockInputRouterClient::GetAndResetFilterEventCalled() { |
70 bool filter_input_event_called = filter_input_event_called_; | 66 bool filter_input_event_called = filter_input_event_called_; |
71 filter_input_event_called_ = false; | 67 filter_input_event_called_ = false; |
72 return filter_input_event_called; | 68 return filter_input_event_called; |
73 } | 69 } |
74 | 70 |
75 size_t MockInputRouterClient::GetAndResetDidFlushCount() { | 71 size_t MockInputRouterClient::GetAndResetDidFlushCount() { |
76 size_t did_flush_called_count = did_flush_called_count_; | 72 size_t did_flush_called_count = did_flush_called_count_; |
77 did_flush_called_count_ = 0; | 73 did_flush_called_count_ = 0; |
78 return did_flush_called_count; | 74 return did_flush_called_count; |
79 } | 75 } |
80 | 76 |
81 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { | 77 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { |
82 DidOverscrollParams overscroll; | 78 DidOverscrollParams overscroll; |
83 std::swap(overscroll_, overscroll); | 79 std::swap(overscroll_, overscroll); |
84 return overscroll; | 80 return overscroll; |
85 } | 81 } |
86 | 82 |
87 } // namespace content | 83 } // namespace content |
OLD | NEW |