Index: ui/touch_selection/touch_handle_unittest.cc |
diff --git a/ui/touch_selection/touch_handle_unittest.cc b/ui/touch_selection/touch_handle_unittest.cc |
index e86c3d3881b245953f17aa8621166e934718b1dc..8e929815157bca518ed896be97dfd1dfac95e529 100644 |
--- a/ui/touch_selection/touch_handle_unittest.cc |
+++ b/ui/touch_selection/touch_handle_unittest.cc |
@@ -15,7 +15,7 @@ namespace ui { |
namespace { |
const int kDefaultTapTimeoutMs = 200; |
-const float kDefaultTapSlop = 10.f; |
+const double kDefaultTapSlop = 10.; |
const float kDefaultDrawableSize = 10.f; |
struct MockDrawableData { |
@@ -74,20 +74,25 @@ class TouchHandleTest : public testing::Test, public TouchHandleClient { |
~TouchHandleTest() override {} |
// TouchHandleClient implementation. |
- void OnHandleDragBegin(const TouchHandle& handle) override { |
+ void OnDragBegin(const TouchSelectionDraggable& handler, |
+ const gfx::PointF& drag_position) override { |
dragging_ = true; |
} |
- void OnHandleDragUpdate(const TouchHandle& handle, |
- const gfx::PointF& new_position) override { |
+ void OnDragUpdate(const TouchSelectionDraggable& handler, |
+ const gfx::PointF& drag_position) override { |
dragged_ = true; |
- drag_position_ = new_position; |
+ drag_position_ = drag_position; |
} |
- void OnHandleDragEnd(const TouchHandle& handle) override { |
+ void OnDragEnd(const TouchSelectionDraggable& handler) override { |
dragging_ = false; |
} |
+ bool IsWithinTapSlop(const gfx::Vector2dF& delta) const override { |
+ return delta.LengthSquared() < (kDefaultTapSlop * kDefaultTapSlop); |
+ } |
+ |
void OnHandleTapped(const TouchHandle& handle) override { tapped_ = true; } |
void SetNeedsAnimate() override { needs_animate_ = true; } |
@@ -100,8 +105,6 @@ class TouchHandleTest : public testing::Test, public TouchHandleClient { |
return base::TimeDelta::FromMilliseconds(kDefaultTapTimeoutMs); |
} |
- float GetTapSlop() const override { return kDefaultTapSlop; } |
- |
void Animate(TouchHandle& handle) { |
needs_animate_ = false; |
base::TimeTicks now = base::TimeTicks::Now(); |