aura: Enable touch initiated drag and drop.
Touch drag/drop in aura follows the following rules:
1. Initiate drag on long press gesture. Give the user a visual cue by showing
a scaled up drag image.
2. Do not initiate dnd if there is no drag image.
3. If, after initiating a drag, the user lifts up their finger without moving,
cancel the drag and show a context menu (this is implemented using the long tap
gesture).
BUG=114755
Review URL: https://chromiumcodereview.appspot.com/11368131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169901 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc
index dfefe82..279e17e 100644
--- a/ash/drag_drop/drag_drop_tracker_unittest.cc
+++ b/ash/drag_drop/drag_drop_tracker_unittest.cc
@@ -43,11 +43,11 @@
return target;
}
- static ui::MouseEvent* ConvertMouseEvent(aura::Window* target,
+ static ui::LocatedEvent* ConvertEvent(aura::Window* target,
const ui::MouseEvent& event) {
scoped_ptr<internal::DragDropTracker> tracker(
new internal::DragDropTracker);
- ui::MouseEvent* converted = tracker->ConvertMouseEvent(target, event);
+ ui::LocatedEvent* converted = tracker->ConvertEvent(target, event);
return converted;
}
};
@@ -122,12 +122,12 @@
// TODO(mazda): Remove this once ash/wm/coordinate_conversion.h supports
// non-X11 platforms.
#if defined(USE_X11)
-#define MAYBE_ConvertMouseEvent ConvertMouseEvent
+#define MAYBE_ConvertEvent ConvertEvent
#else
-#define MAYBE_ConvertMouseEvent DISABLED_ConvertMouseEvent
+#define MAYBE_ConvertEvent DISABLED_ConvertEvent
#endif
-TEST_F(DragDropTrackerTest, MAYBE_ConvertMouseEvent) {
+TEST_F(DragDropTrackerTest, MAYBE_ConvertEvent) {
Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
EXPECT_EQ(2U, root_windows.size());
@@ -150,8 +150,8 @@
gfx::Point(50, 50),
gfx::Point(50, 50),
ui::EF_NONE);
- scoped_ptr<ui::MouseEvent> converted00(ConvertMouseEvent(window0.get(),
- original00));
+ scoped_ptr<ui::LocatedEvent> converted00(ConvertEvent(window0.get(),
+ original00));
EXPECT_EQ(original00.type(), converted00->type());
EXPECT_EQ("50,50", converted00->location().ToString());
EXPECT_EQ("50,50", converted00->root_location().ToString());
@@ -163,8 +163,8 @@
gfx::Point(350, 150),
gfx::Point(350, 150),
ui::EF_NONE);
- scoped_ptr<ui::MouseEvent> converted01(ConvertMouseEvent(window1.get(),
- original01));
+ scoped_ptr<ui::LocatedEvent> converted01(ConvertEvent(window1.get(),
+ original01));
EXPECT_EQ(original01.type(), converted01->type());
EXPECT_EQ("50,50", converted01->location().ToString());
EXPECT_EQ("150,150", converted01->root_location().ToString());
@@ -179,8 +179,8 @@
gfx::Point(-150, 50),
gfx::Point(-150, 50),
ui::EF_NONE);
- scoped_ptr<ui::MouseEvent> converted10(ConvertMouseEvent(window0.get(),
- original10));
+ scoped_ptr<ui::LocatedEvent> converted10(ConvertEvent(window0.get(),
+ original10));
EXPECT_EQ(original10.type(), converted10->type());
EXPECT_EQ("50,50", converted10->location().ToString());
EXPECT_EQ("50,50", converted10->root_location().ToString());
@@ -192,7 +192,7 @@
gfx::Point(150, 150),
gfx::Point(150, 150),
ui::EF_NONE);
- scoped_ptr<ui::MouseEvent> converted11(ConvertMouseEvent(window1.get(),
+ scoped_ptr<ui::LocatedEvent> converted11(ConvertEvent(window1.get(),
original11));
EXPECT_EQ(original11.type(), converted11->type());
EXPECT_EQ("50,50", converted11->location().ToString());