| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 ++did_flush_called_count_; | 54 ++did_flush_called_count_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { | 57 void MockInputRouterClient::DidOverscroll(const DidOverscrollParams& params) { |
| 58 overscroll_ = params; | 58 overscroll_ = params; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void MockInputRouterClient::DidStopFlinging() { | 61 void MockInputRouterClient::DidStopFlinging() { |
| 62 } | 62 } |
| 63 | 63 |
| 64 void MockInputRouterClient::ForwardGestureEvent( |
| 65 const blink::WebGestureEvent& gesture_event) { |
| 66 if (input_router_) |
| 67 input_router_->SendGestureEvent( |
| 68 GestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo())); |
| 69 } |
| 70 |
| 64 bool MockInputRouterClient::GetAndResetFilterEventCalled() { | 71 bool MockInputRouterClient::GetAndResetFilterEventCalled() { |
| 65 bool filter_input_event_called = filter_input_event_called_; | 72 bool filter_input_event_called = filter_input_event_called_; |
| 66 filter_input_event_called_ = false; | 73 filter_input_event_called_ = false; |
| 67 return filter_input_event_called; | 74 return filter_input_event_called; |
| 68 } | 75 } |
| 69 | 76 |
| 70 size_t MockInputRouterClient::GetAndResetDidFlushCount() { | 77 size_t MockInputRouterClient::GetAndResetDidFlushCount() { |
| 71 size_t did_flush_called_count = did_flush_called_count_; | 78 size_t did_flush_called_count = did_flush_called_count_; |
| 72 did_flush_called_count_ = 0; | 79 did_flush_called_count_ = 0; |
| 73 return did_flush_called_count; | 80 return did_flush_called_count; |
| 74 } | 81 } |
| 75 | 82 |
| 76 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { | 83 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { |
| 77 DidOverscrollParams overscroll; | 84 DidOverscrollParams overscroll; |
| 78 std::swap(overscroll_, overscroll); | 85 std::swap(overscroll_, overscroll); |
| 79 return overscroll; | 86 return overscroll; |
| 80 } | 87 } |
| 81 | 88 |
| 82 } // namespace content | 89 } // namespace content |
| OLD | NEW |