| 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 #ifndef CONTENT_TEST_WEB_GESTURE_CURVE_MOCK_H_ | 5 #ifndef CONTENT_TEST_WEB_GESTURE_CURVE_MOCK_H_ |
| 6 #define CONTENT_TEST_WEB_GESTURE_CURVE_MOCK_H_ | 6 #define CONTENT_TEST_WEB_GESTURE_CURVE_MOCK_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 10 #include "third_party/WebKit/public/platform/WebGestureCurve.h" | 11 #include "third_party/WebKit/public/platform/WebGestureCurve.h" |
| 11 #include "third_party/WebKit/public/platform/WebSize.h" | 12 #include "third_party/WebKit/public/platform/WebSize.h" |
| 12 | 13 |
| 13 // A simple class for mocking a WebGestureCurve. The curve flings at velocity | 14 // A simple class for mocking a WebGestureCurve. The curve flings at velocity |
| 14 // indefinitely. | 15 // indefinitely. |
| 15 class WebGestureCurveMock : public blink::WebGestureCurve { | 16 class WebGestureCurveMock : public blink::WebGestureCurve { |
| 16 public: | 17 public: |
| 17 WebGestureCurveMock(const blink::WebFloatPoint& velocity, | 18 WebGestureCurveMock(const blink::WebFloatPoint& velocity, |
| 18 const blink::WebSize& cumulative_scroll); | 19 const blink::WebSize& cumulative_scroll); |
| 19 ~WebGestureCurveMock() override; | 20 ~WebGestureCurveMock() override; |
| 20 | 21 |
| 21 // Returns false if curve has finished and can no longer be applied. | 22 // Returns false if curve has finished and can no longer be applied. |
| 22 bool apply(double time, blink::WebGestureCurveTarget* target) override; | 23 bool apply(double time, blink::WebGestureCurveTarget* target) override; |
| 23 | 24 |
| 24 private: | 25 private: |
| 25 blink::WebFloatPoint velocity_; | 26 blink::WebFloatPoint velocity_; |
| 26 blink::WebSize cumulative_scroll_; | 27 blink::WebSize cumulative_scroll_; |
| 27 | 28 |
| 28 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveMock); | 29 DISALLOW_COPY_AND_ASSIGN(WebGestureCurveMock); |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 #endif // CONTENT_TEST_WEB_GESTURE_CURVE_MOCK_H_ | 32 #endif // CONTENT_TEST_WEB_GESTURE_CURVE_MOCK_H_ |
| OLD | NEW |