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

Unified Diff: ui/touch_selection/touch_handle_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/touch_handle.cc ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f04b209fe27b38c1e906daf805080ce08434bc3..8d6c321b4de6e3076903c88425c1527634dd2879 100644
--- a/ui/touch_selection/touch_handle_unittest.cc
+++ b/ui/touch_selection/touch_handle_unittest.cc
@@ -84,19 +84,22 @@ class TouchHandleTest : public testing::Test, public TouchHandleClient {
~TouchHandleTest() override {}
// TouchHandleClient implementation.
- void OnDragBegin(const TouchSelectionDraggable& handler,
- const gfx::PointF& drag_position) override {
- dragging_ = true;
- }
-
- void OnDragUpdate(const TouchSelectionDraggable& handler,
- const gfx::PointF& drag_position) override {
- dragged_ = true;
- 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;
+ break;
+ case HANDLE_DRAG_UPDATE:
+ dragged_ = true;
+ 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/touch_handle.cc ('k') | ui/touch_selection/touch_selection_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698