| 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( | 64 void MockInputRouterClient::ForwardGestureEventWithLatencyInfo( |
| 65 const blink::WebGestureEvent& gesture_event) { | 65 const blink::WebGestureEvent& gesture_event, |
| 66 const ui::LatencyInfo& latency_info) { |
| 66 if (input_router_) | 67 if (input_router_) |
| 67 input_router_->SendGestureEvent( | 68 input_router_->SendGestureEvent( |
| 68 GestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo())); | 69 GestureEventWithLatencyInfo(gesture_event, latency_info)); |
| 69 } | 70 } |
| 70 | 71 |
| 71 bool MockInputRouterClient::GetAndResetFilterEventCalled() { | 72 bool MockInputRouterClient::GetAndResetFilterEventCalled() { |
| 72 bool filter_input_event_called = filter_input_event_called_; | 73 bool filter_input_event_called = filter_input_event_called_; |
| 73 filter_input_event_called_ = false; | 74 filter_input_event_called_ = false; |
| 74 return filter_input_event_called; | 75 return filter_input_event_called; |
| 75 } | 76 } |
| 76 | 77 |
| 77 size_t MockInputRouterClient::GetAndResetDidFlushCount() { | 78 size_t MockInputRouterClient::GetAndResetDidFlushCount() { |
| 78 size_t did_flush_called_count = did_flush_called_count_; | 79 size_t did_flush_called_count = did_flush_called_count_; |
| 79 did_flush_called_count_ = 0; | 80 did_flush_called_count_ = 0; |
| 80 return did_flush_called_count; | 81 return did_flush_called_count; |
| 81 } | 82 } |
| 82 | 83 |
| 83 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { | 84 DidOverscrollParams MockInputRouterClient::GetAndResetOverscroll() { |
| 84 DidOverscrollParams overscroll; | 85 DidOverscrollParams overscroll; |
| 85 std::swap(overscroll_, overscroll); | 86 std::swap(overscroll_, overscroll); |
| 86 return overscroll; | 87 return overscroll; |
| 87 } | 88 } |
| 88 | 89 |
| 89 } // namespace content | 90 } // namespace content |
| OLD | NEW |