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

Unified Diff: ui/events/android/drag_event_android.cc

Issue 2896993002: Route OnDragEvent through ViewAndroid tree (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: ui/events/android/drag_event_android.cc
diff --git a/ui/events/android/drag_event_android.cc b/ui/events/android/drag_event_android.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4efd417d4262aaf7417a9b88826df49284491f97
--- /dev/null
+++ b/ui/events/android/drag_event_android.cc
@@ -0,0 +1,36 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/events/android/drag_event_android.h"
+
+#include "ui/events/event_utils.h"
+#include "ui/gfx/geometry/point_f.h"
+
+namespace ui {
+
+DragEventAndroid::DragEventAndroid(
+ int action,
+ const gfx::PointF& location,
+ const gfx::PointF& screen_location,
+ const std::vector<base::string16>& mime_types,
+ const base::string16& content)
+ : LocatedEvent(ET_DROP_TARGET_EVENT,
+ location,
+ screen_location,
+ EventTimeForNow(),
+ 0),
+ action_(action),
+ mime_types_(mime_types),
+ content_(content) {}
+
+std::unique_ptr<DragEventAndroid> DragEventAndroid::CreateFor(
+ const gfx::Point& location) const {
+ gfx::PointF new_location(location);
+ gfx::PointF new_screen_location =
+ new_location + (root_location_f() - location_f());
aelias_OOO_until_Jul13 2017/05/24 22:25:40 Terminology and calculation seems weird here. "sc
Jinsuk Kim 2017/05/25 03:18:19 Agreed that storing screen location to root locati
+ return std::unique_ptr<DragEventAndroid>(new DragEventAndroid(
+ action_, new_location, new_screen_location, mime_types_, content_));
+}
+
+} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698