OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/widget/desktop_aura/desktop_drop_target_win.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drop_target_win.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/win/win_util.h" | 9 #include "base/win/win_util.h" |
10 #include "ui/aura/client/drag_drop_client.h" | 10 #include "ui/aura/client/drag_drop_client.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void DesktopDropTargetWin::Translate( | 122 void DesktopDropTargetWin::Translate( |
123 IDataObject* data_object, | 123 IDataObject* data_object, |
124 DWORD key_state, | 124 DWORD key_state, |
125 POINT position, | 125 POINT position, |
126 DWORD effect, | 126 DWORD effect, |
127 std::unique_ptr<OSExchangeData>* data, | 127 std::unique_ptr<OSExchangeData>* data, |
128 std::unique_ptr<ui::DropTargetEvent>* event, | 128 std::unique_ptr<ui::DropTargetEvent>* event, |
129 DragDropDelegate** delegate) { | 129 DragDropDelegate** delegate) { |
130 gfx::Point location(position.x, position.y); | 130 gfx::Point location(position.x, position.y); |
131 gfx::Point root_location = location; | 131 gfx::Point root_location = location; |
132 root_window_->GetHost()->ConvertPointFromNativeScreen( | 132 root_window_->GetHost()->ConvertScreenInPixelsToDIP(&root_location); |
133 &root_location); | |
134 aura::Window* target_window = | 133 aura::Window* target_window = |
135 root_window_->GetEventHandlerForPoint(root_location); | 134 root_window_->GetEventHandlerForPoint(root_location); |
136 bool target_window_changed = false; | 135 bool target_window_changed = false; |
137 if (target_window != target_window_) { | 136 if (target_window != target_window_) { |
138 if (target_window_) | 137 if (target_window_) |
139 NotifyDragLeave(); | 138 NotifyDragLeave(); |
140 target_window_ = target_window; | 139 target_window_ = target_window; |
141 if (target_window_) | 140 if (target_window_) |
142 target_window_->AddObserver(this); | 141 target_window_->AddObserver(this); |
143 target_window_changed = true; | 142 target_window_changed = true; |
(...skipping 24 matching lines...) Expand all Loading... |
168 return; | 167 return; |
169 DragDropDelegate* delegate = | 168 DragDropDelegate* delegate = |
170 aura::client::GetDragDropDelegate(target_window_); | 169 aura::client::GetDragDropDelegate(target_window_); |
171 if (delegate) | 170 if (delegate) |
172 delegate->OnDragExited(); | 171 delegate->OnDragExited(); |
173 target_window_->RemoveObserver(this); | 172 target_window_->RemoveObserver(this); |
174 target_window_ = NULL; | 173 target_window_ = NULL; |
175 } | 174 } |
176 | 175 |
177 } // namespace views | 176 } // namespace views |
OLD | NEW |