| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
| 6 | 6 |
| 7 #include "ash/drag_drop/drag_drop_tracker.h" | 7 #include "ash/drag_drop/drag_drop_tracker.h" |
| 8 #include "ash/drag_drop/drag_image_view.h" | 8 #include "ash/drag_drop/drag_image_view.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/coordinate_conversion.h" | 10 #include "ash/wm/coordinate_conversion.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 Shell::GetInstance()->AddEnvEventFilter(this); | 49 Shell::GetInstance()->AddEnvEventFilter(this); |
| 50 } | 50 } |
| 51 | 51 |
| 52 DragDropController::~DragDropController() { | 52 DragDropController::~DragDropController() { |
| 53 Shell::GetInstance()->RemoveEnvEventFilter(this); | 53 Shell::GetInstance()->RemoveEnvEventFilter(this); |
| 54 Cleanup(); | 54 Cleanup(); |
| 55 if (drag_image_.get()) | 55 if (drag_image_.get()) |
| 56 drag_image_.reset(); | 56 drag_image_.reset(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data, | 59 int DragDropController::StartDragAndDrop( |
| 60 aura::RootWindow* root_window, | 60 const ui::OSExchangeData& data, |
| 61 const gfx::Point& root_location, | 61 aura::RootWindow* root_window, |
| 62 int operation) { | 62 const gfx::Point& root_location, |
| 63 int operation, |
| 64 ui::DragDropTypes::DragEventSource source) { |
| 63 DCHECK(!IsDragDropInProgress()); | 65 DCHECK(!IsDragDropInProgress()); |
| 64 | 66 |
| 65 drag_drop_tracker_.reset(new DragDropTracker); | 67 drag_drop_tracker_.reset(new DragDropTracker); |
| 66 | 68 |
| 67 drag_data_ = &data; | 69 drag_data_ = &data; |
| 68 drag_operation_ = operation; | 70 drag_operation_ = operation; |
| 69 const ui::OSExchangeDataProviderAura& provider = | 71 const ui::OSExchangeDataProviderAura& provider = |
| 70 static_cast<const ui::OSExchangeDataProviderAura&>(data.provider()); | 72 static_cast<const ui::OSExchangeDataProviderAura&>(data.provider()); |
| 71 | 73 |
| 72 drag_image_.reset(new DragImageView); | 74 drag_image_.reset(new DragImageView); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 drag_window_->RemoveObserver(this); | 300 drag_window_->RemoveObserver(this); |
| 299 drag_window_ = NULL; | 301 drag_window_ = NULL; |
| 300 drag_data_ = NULL; | 302 drag_data_ = NULL; |
| 301 // Cleanup can be called again while deleting DragDropTracker, so use Pass | 303 // Cleanup can be called again while deleting DragDropTracker, so use Pass |
| 302 // instead of reset to avoid double free. | 304 // instead of reset to avoid double free. |
| 303 drag_drop_tracker_.Pass(); | 305 drag_drop_tracker_.Pass(); |
| 304 } | 306 } |
| 305 | 307 |
| 306 } // namespace internal | 308 } // namespace internal |
| 307 } // namespace ash | 309 } // namespace ash |
| OLD | NEW |