Chromium Code Reviews| 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/renderer/input/input_handler_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/base/swap_promise_monitor.h" | 9 #include "cc/base/swap_promise_monitor.h" |
| 10 #include "content/renderer/input/input_handler_proxy_client.h" | 10 #include "content/renderer/input/input_handler_proxy_client.h" |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 MOCK_METHOD2(PinchGestureUpdate, | 40 MOCK_METHOD2(PinchGestureUpdate, |
| 41 void(float magnify_delta, gfx::Point anchor)); | 41 void(float magnify_delta, gfx::Point anchor)); |
| 42 MOCK_METHOD0(PinchGestureEnd, void()); | 42 MOCK_METHOD0(PinchGestureEnd, void()); |
| 43 | 43 |
| 44 MOCK_METHOD0(ScheduleAnimation, void()); | 44 MOCK_METHOD0(ScheduleAnimation, void()); |
| 45 | 45 |
| 46 MOCK_METHOD2(ScrollBegin, | 46 MOCK_METHOD2(ScrollBegin, |
| 47 ScrollStatus(gfx::Point viewport_point, | 47 ScrollStatus(gfx::Point viewport_point, |
| 48 cc::InputHandler::ScrollInputType type)); | 48 cc::InputHandler::ScrollInputType type)); |
| 49 MOCK_METHOD2(ScrollBy, | 49 MOCK_METHOD2(ScrollBy, |
| 50 bool(gfx::Point viewport_point, gfx::Vector2dF scroll_delta)); | 50 bool(gfx::Point viewport_point, |
| 51 const gfx::Vector2dF& scroll_delta)); | |
|
jdduke (slow)
2014/01/22 18:07:28
Nit: Please align the second arg with the first (i
| |
| 51 MOCK_METHOD2(ScrollVerticallyByPage, | 52 MOCK_METHOD2(ScrollVerticallyByPage, |
| 52 bool(gfx::Point viewport_point, | 53 bool(gfx::Point viewport_point, |
| 53 cc::ScrollDirection direction)); | 54 cc::ScrollDirection direction)); |
| 54 MOCK_METHOD0(ScrollEnd, void()); | 55 MOCK_METHOD0(ScrollEnd, void()); |
| 55 MOCK_METHOD0(FlingScrollBegin, cc::InputHandler::ScrollStatus()); | 56 MOCK_METHOD0(FlingScrollBegin, cc::InputHandler::ScrollStatus()); |
| 56 | 57 |
| 57 virtual scoped_ptr<cc::SwapPromiseMonitor> | 58 virtual scoped_ptr<cc::SwapPromiseMonitor> |
| 58 CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) OVERRIDE { | 59 CreateLatencyInfoSwapPromiseMonitor(ui::LatencyInfo* latency) OVERRIDE { |
| 59 return scoped_ptr<cc::SwapPromiseMonitor>(); | 60 return scoped_ptr<cc::SwapPromiseMonitor>(); |
| 60 } | 61 } |
| 61 | 62 |
| 62 virtual void BindToClient(cc::InputHandlerClient* client) OVERRIDE {} | 63 virtual void BindToClient(cc::InputHandlerClient* client) OVERRIDE {} |
| 63 | 64 |
| 64 virtual void StartPageScaleAnimation(gfx::Vector2d target_offset, | 65 virtual void StartPageScaleAnimation(gfx::Vector2d target_offset, |
| 65 bool anchor_point, | 66 bool anchor_point, |
| 66 float page_scale, | 67 float page_scale, |
| 67 base::TimeDelta duration) OVERRIDE {} | 68 base::TimeDelta duration) OVERRIDE {} |
| 68 | 69 |
| 69 virtual void NotifyCurrentFlingVelocity(gfx::Vector2dF velocity) OVERRIDE {} | 70 virtual void NotifyCurrentFlingVelocity( |
| 71 const gfx::Vector2dF& velocity) OVERRIDE {} | |
| 70 virtual void MouseMoveAt(gfx::Point mouse_position) OVERRIDE {} | 72 virtual void MouseMoveAt(gfx::Point mouse_position) OVERRIDE {} |
| 71 | 73 |
| 72 MOCK_METHOD1(HaveTouchEventHandlersAt, | 74 MOCK_METHOD1(HaveTouchEventHandlersAt, |
| 73 bool(gfx::Point point)); | 75 bool(gfx::Point point)); |
| 74 | 76 |
| 75 virtual void SetRootLayerScrollOffsetDelegate( | 77 virtual void SetRootLayerScrollOffsetDelegate( |
| 76 cc::LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) | 78 cc::LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) |
| 77 OVERRIDE {} | 79 OVERRIDE {} |
| 78 | 80 |
| 79 virtual void OnRootLayerDelegatedScrollOffsetChanged() OVERRIDE {} | 81 virtual void OnRootLayerDelegatedScrollOffsetChanged() OVERRIDE {} |
| 80 | |
|
danakj
2014/01/22 17:39:43
keep this line?
| |
| 81 DISALLOW_COPY_AND_ASSIGN(MockInputHandler); | 82 DISALLOW_COPY_AND_ASSIGN(MockInputHandler); |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 // A simple WebGestureCurve implementation that flings at a constant velocity | 85 // A simple WebGestureCurve implementation that flings at a constant velocity |
| 85 // indefinitely. | 86 // indefinitely. |
| 86 class FakeWebGestureCurve : public blink::WebGestureCurve { | 87 class FakeWebGestureCurve : public blink::WebGestureCurve { |
| 87 public: | 88 public: |
| 88 FakeWebGestureCurve(const blink::WebFloatPoint& velocity, | 89 FakeWebGestureCurve(const blink::WebFloatPoint& velocity, |
| 89 const blink::WebSize& cumulative_scroll) | 90 const blink::WebSize& cumulative_scroll) |
| 90 : velocity_(velocity), cumulative_scroll_(cumulative_scroll) {} | 91 : velocity_(velocity), cumulative_scroll_(cumulative_scroll) {} |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1214 | 1215 |
| 1215 touch.touches[2].state = WebTouchPoint::StatePressed; | 1216 touch.touches[2].state = WebTouchPoint::StatePressed; |
| 1216 touch.touches[2].screenPosition = WebPoint(-10, 10); | 1217 touch.touches[2].screenPosition = WebPoint(-10, 10); |
| 1217 touch.touches[2].position = WebPoint(-10, 10); | 1218 touch.touches[2].position = WebPoint(-10, 10); |
| 1218 | 1219 |
| 1219 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(touch)); | 1220 EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(touch)); |
| 1220 } | 1221 } |
| 1221 | 1222 |
| 1222 } // namespace | 1223 } // namespace |
| 1223 } // namespace content | 1224 } // namespace content |
| OLD | NEW |