| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 WindowState& state = window_state_[window]; | 204 WindowState& state = window_state_[window]; |
| 205 if (!state.observed) { | 205 if (!state.observed) { |
| 206 state.observed = true; | 206 state.observed = true; |
| 207 window->AddObserver(this); | 207 window->AddObserver(this); |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 void DragController::QueueOperation(ServerWindow* window, | 211 void DragController::QueueOperation(ServerWindow* window, |
| 212 OperationType type, | 212 OperationType type, |
| 213 uint32_t event_flags, | 213 uint32_t event_flags, |
| 214 gfx::Point screen_position) { | 214 const gfx::Point& screen_position) { |
| 215 // If this window doesn't have the mime data, send it. | 215 // If this window doesn't have the mime data, send it. |
| 216 DragTargetConnection* connection = source_->GetDragTargetForWindow(window); | 216 DragTargetConnection* connection = source_->GetDragTargetForWindow(window); |
| 217 if (connection != source_connection_ && | 217 if (connection != source_connection_ && |
| 218 !base::ContainsKey(called_on_drag_mime_types_, connection)) { | 218 !base::ContainsKey(called_on_drag_mime_types_, connection)) { |
| 219 connection->PerformOnDragDropStart(mime_data_.Clone()); | 219 connection->PerformOnDragDropStart(mime_data_.Clone()); |
| 220 called_on_drag_mime_types_.insert(connection); | 220 called_on_drag_mime_types_.insert(connection); |
| 221 } | 221 } |
| 222 | 222 |
| 223 WindowState& state = window_state_[window]; | 223 WindowState& state = window_state_[window]; |
| 224 // Set the queued operation to the incoming. | 224 // Set the queued operation to the incoming. |
| (...skipping 99 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 |