OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/events/android/drag_event_android.h" | |
6 | |
7 #include "ui/events/event_utils.h" | |
8 #include "ui/gfx/geometry/point_f.h" | |
9 | |
10 namespace ui { | |
11 | |
12 DragEventAndroid::DragEventAndroid( | |
13 int action, | |
14 const gfx::PointF& location, | |
15 const gfx::PointF& screen_location, | |
16 const std::vector<base::string16>& mime_types, | |
17 const base::string16& content) | |
18 : LocatedEvent(ET_DROP_TARGET_EVENT, | |
19 location, | |
20 screen_location, | |
21 EventTimeForNow(), | |
22 0), | |
23 action_(action), | |
24 mime_types_(mime_types), | |
25 content_(content) {} | |
26 | |
27 std::unique_ptr<DragEventAndroid> DragEventAndroid::CreateFor( | |
28 const gfx::Point& location) const { | |
29 gfx::PointF new_location(location); | |
30 gfx::PointF new_screen_location = | |
31 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
| |
32 return std::unique_ptr<DragEventAndroid>(new DragEventAndroid( | |
33 action_, new_location, new_screen_location, mime_types_, content_)); | |
34 } | |
35 | |
36 } // namespace ui | |
OLD | NEW |