OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/mus/drag_drop_controller_mus.h" | 5 #include "ui/aura/mus/drag_drop_controller_mus.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 return drag_drop_delegate->OnDragUpdated(*event); | 191 return drag_drop_delegate->OnDragUpdated(*event); |
192 } | 192 } |
193 | 193 |
194 std::unique_ptr<ui::DropTargetEvent> | 194 std::unique_ptr<ui::DropTargetEvent> |
195 DragDropControllerMus::CreateDropTargetEvent(Window* window, | 195 DragDropControllerMus::CreateDropTargetEvent(Window* window, |
196 uint32_t event_flags, | 196 uint32_t event_flags, |
197 const gfx::Point& screen_location, | 197 const gfx::Point& screen_location, |
198 uint32_t effect_bitmask) { | 198 uint32_t effect_bitmask) { |
199 DCHECK(window->GetHost()); | 199 DCHECK(window->GetHost()); |
200 gfx::Point root_location = screen_location; | 200 gfx::Point root_location = screen_location; |
201 window->GetHost()->ConvertPointFromNativeScreen(&root_location); | 201 window->GetHost()->ConvertScreenInPixelsToDIP(&root_location); |
202 gfx::Point location = root_location; | 202 gfx::Point location = root_location; |
203 Window::ConvertPointToTarget(window->GetRootWindow(), window, &location); | 203 Window::ConvertPointToTarget(window->GetRootWindow(), window, &location); |
204 std::unique_ptr<ui::DropTargetEvent> event = | 204 std::unique_ptr<ui::DropTargetEvent> event = |
205 base::MakeUnique<ui::DropTargetEvent>( | 205 base::MakeUnique<ui::DropTargetEvent>( |
206 current_drag_state_ ? current_drag_state_->drag_data | 206 current_drag_state_ ? current_drag_state_->drag_data |
207 : *(os_exchange_data_.get()), | 207 : *(os_exchange_data_.get()), |
208 location, root_location, effect_bitmask); | 208 location, root_location, effect_bitmask); |
209 event->set_flags(event_flags); | 209 event->set_flags(event_flags); |
210 return event; | 210 return event; |
211 } | 211 } |
212 | 212 |
213 } // namespace aura | 213 } // namespace aura |
OLD | NEW |