| 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 "services/ui/ws/drag_controller.h" | 5 #include "services/ui/ws/drag_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "services/ui/public/interfaces/cursor.mojom.h" | 10 #include "services/ui/public/interfaces/cursor.mojom.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 event.flags() & | 79 event.flags() & |
| 80 (ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN); | 80 (ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN); |
| 81 gfx::Point screen_position = event.location(); | 81 gfx::Point screen_position = event.location(); |
| 82 | 82 |
| 83 if (waiting_for_final_drop_response_) { | 83 if (waiting_for_final_drop_response_) { |
| 84 // If we're waiting on a target window to respond to the final drag drop | 84 // If we're waiting on a target window to respond to the final drag drop |
| 85 // call, don't process any more pointer events. | 85 // call, don't process any more pointer events. |
| 86 return false; | 86 return false; |
| 87 } | 87 } |
| 88 | 88 |
| 89 if (event.pointer_id() != drag_pointer_id_) | 89 if (event.pointer_details().id != drag_pointer_id_) |
| 90 return false; | 90 return false; |
| 91 | 91 |
| 92 // If |current_target| doesn't accept drags, walk its hierarchy up until we | 92 // If |current_target| doesn't accept drags, walk its hierarchy up until we |
| 93 // find one that does (or set to nullptr at the top of the tree). | 93 // find one that does (or set to nullptr at the top of the tree). |
| 94 while (current_target && !current_target->can_accept_drops()) | 94 while (current_target && !current_target->can_accept_drops()) |
| 95 current_target = current_target->parent(); | 95 current_target = current_target->parent(); |
| 96 | 96 |
| 97 if (current_target) { | 97 if (current_target) { |
| 98 // If we're non-null, we're about to use |current_target| in some | 98 // If we're non-null, we're about to use |current_target| in some |
| 99 // way. Ensure that we receive notifications that this window has gone | 99 // way. Ensure that we receive notifications that this window has gone |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 324 |
| 325 if (source_window_ == window) { | 325 if (source_window_ == window) { |
| 326 source_window_ = nullptr; | 326 source_window_ = nullptr; |
| 327 // Our source window is being deleted, fail the drag. | 327 // Our source window is being deleted, fail the drag. |
| 328 MessageDragCompleted(false, ui::mojom::kDropEffectNone); | 328 MessageDragCompleted(false, ui::mojom::kDropEffectNone); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace ws | 332 } // namespace ws |
| 333 } // namespace ui | 333 } // namespace ui |
| OLD | NEW |