| 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/views/mus/drop_target_mus.h" | 5 #include "ui/views/mus/drop_target_mus.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 DropTargetMus::~DropTargetMus() {} | 35 DropTargetMus::~DropTargetMus() {} |
| 36 | 36 |
| 37 void DropTargetMus::Translate(uint32_t key_state, | 37 void DropTargetMus::Translate(uint32_t key_state, |
| 38 const gfx::Point& screen_location, | 38 const gfx::Point& screen_location, |
| 39 uint32_t effect, | 39 uint32_t effect, |
| 40 std::unique_ptr<ui::DropTargetEvent>* event, | 40 std::unique_ptr<ui::DropTargetEvent>* event, |
| 41 aura::client::DragDropDelegate** delegate) { | 41 aura::client::DragDropDelegate** delegate) { |
| 42 gfx::Point location = screen_location; | 42 gfx::Point location = screen_location; |
| 43 gfx::Point root_location = location; | 43 gfx::Point root_location = location; |
| 44 root_window_->GetHost()->ConvertPointFromNativeScreen(&root_location); | 44 root_window_->GetHost()->ConvertScreenInPixelsToDIP(&root_location); |
| 45 aura::Window* target_window = | 45 aura::Window* target_window = |
| 46 root_window_->GetEventHandlerForPoint(root_location); | 46 root_window_->GetEventHandlerForPoint(root_location); |
| 47 bool target_window_changed = false; | 47 bool target_window_changed = false; |
| 48 if (target_window != target_window_) { | 48 if (target_window != target_window_) { |
| 49 if (target_window_) | 49 if (target_window_) |
| 50 NotifyDragExited(); | 50 NotifyDragExited(); |
| 51 target_window_ = target_window; | 51 target_window_ = target_window; |
| 52 if (target_window_) | 52 if (target_window_) |
| 53 target_window_->AddObserver(this); | 53 target_window_->AddObserver(this); |
| 54 target_window_changed = true; | 54 target_window_changed = true; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 void DropTargetMus::OnDragDropDone() { | 137 void DropTargetMus::OnDragDropDone() { |
| 138 os_exchange_data_.reset(); | 138 os_exchange_data_.reset(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void DropTargetMus::OnWindowDestroyed(aura::Window* window) { | 141 void DropTargetMus::OnWindowDestroyed(aura::Window* window) { |
| 142 DCHECK_EQ(window, target_window_); | 142 DCHECK_EQ(window, target_window_); |
| 143 target_window_ = nullptr; | 143 target_window_ = nullptr; |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace views | 146 } // namespace views |
| OLD | NEW |