| 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 { |
| 54 return NULL; |
| 55 } |
| 56 |
| 57 void MockInputRouterClient::DidFlush() { |
| 58 ++did_flush_called_count_; |
| 59 } |
| 60 |
| 61 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { |
| 62 overscroll_ = params; |
| 63 } |
| 64 |
| 65 void MockInputRouterClient::SetNeedsFlush() { |
| 66 set_needs_flush_called_ = true; |
| 67 } |
| 68 |
| 53 bool MockInputRouterClient::GetAndResetFilterEventCalled() { | 69 bool MockInputRouterClient::GetAndResetFilterEventCalled() { |
| 54 bool filter_input_event_called = filter_input_event_called_; | 70 bool filter_input_event_called = filter_input_event_called_; |
| 55 filter_input_event_called_ = false; | 71 filter_input_event_called_ = false; |
| 56 return filter_input_event_called; | 72 return filter_input_event_called; |
| 57 } | 73 } |
| 58 | 74 |
| 59 size_t MockInputRouterClient::GetAndResetDidFlushCount() { | 75 size_t MockInputRouterClient::GetAndResetDidFlushCount() { |
| 60 size_t did_flush_called_count = did_flush_called_count_; | 76 size_t did_flush_called_count = did_flush_called_count_; |
| 61 did_flush_called_count_ = 0; | 77 did_flush_called_count_ = 0; |
| 62 return did_flush_called_count; | 78 return did_flush_called_count; |
| 63 } | 79 } |
| 64 | 80 |
| 65 OverscrollController* MockInputRouterClient::GetOverscrollController() const { | 81 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { |
| 66 return NULL; | 82 DidOverscrollParams overscroll; |
| 67 } | 83 std::swap(overscroll_, overscroll); |
| 68 | 84 return overscroll; |
| 69 void MockInputRouterClient::DidFlush() { | |
| 70 ++did_flush_called_count_; | |
| 71 } | |
| 72 | |
| 73 void MockInputRouterClient::SetNeedsFlush() { | |
| 74 set_needs_flush_called_ = true; | |
| 75 } | 85 } |
| 76 | 86 |
| 77 } // namespace content | 87 } // namespace content |
| OLD | NEW |