Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: ui/touch_selection/longpress_drag_selector_unittest.cc

Issue 1424683002: Refactor TouchSelectionDraggableClient APIs Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/touch_selection/longpress_drag_selector.cc ('k') | ui/touch_selection/touch_handle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/touch_selection/longpress_drag_selector_unittest.cc
diff --git a/ui/touch_selection/longpress_drag_selector_unittest.cc b/ui/touch_selection/longpress_drag_selector_unittest.cc
index 885943957b65b6f075e2538509ed9f52e642c3f2..fedec0880cb958e1478f7d3dfac47c9072de1c90 100644
--- a/ui/touch_selection/longpress_drag_selector_unittest.cc
+++ b/ui/touch_selection/longpress_drag_selector_unittest.cc
@@ -39,19 +39,22 @@ class LongPressDragSelectorTest : public testing::Test,
const gfx::PointF& DragPosition() const { return drag_position_; }
// LongPressDragSelectorClient implementation.
- void OnDragBegin(const TouchSelectionDraggable& handler,
- const gfx::PointF& drag_position) override {
- dragging_ = true;
- drag_position_ = drag_position;
- }
-
- void OnDragUpdate(const TouchSelectionDraggable& handler,
- const gfx::PointF& drag_position) override {
- drag_position_ = drag_position;
- }
-
- void OnDragEnd(const TouchSelectionDraggable& handler) override {
- dragging_ = false;
+ void OnDragEvent(const TouchHandleDragEvent event,
+ const TouchSelectionDraggable& draggable,
+ const gfx::PointF& position) override {
+ switch (event) {
+ case HANDLE_DRAG_BEGIN:
+ dragging_ = true;
+ drag_position_ = position;
+ break;
+ case HANDLE_DRAG_UPDATE:
+ drag_position_ = position;
+ break;
+ case HANDLE_DRAG_END:
+ dragging_ = false;
+ default:
+ NOTREACHED() << "Invalid handle drag event";
+ }
}
bool IsWithinTapSlop(const gfx::Vector2dF& delta) const override {
« no previous file with comments | « ui/touch_selection/longpress_drag_selector.cc ('k') | ui/touch_selection/touch_handle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698