| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/drag_drop/drag_drop_tracker.h" | 9 #include "ash/drag_drop/drag_drop_tracker.h" |
| 10 #include "ash/drag_drop/drag_image_view.h" | 10 #include "ash/drag_drop/drag_image_view.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 // DragDropController, private: | 495 // DragDropController, private: |
| 496 | 496 |
| 497 void DragDropController::AnimationEnded(const gfx::Animation* animation) { | 497 void DragDropController::AnimationEnded(const gfx::Animation* animation) { |
| 498 cancel_animation_.reset(); | 498 cancel_animation_.reset(); |
| 499 | 499 |
| 500 // By the time we finish animation, another drag/drop session may have | 500 // By the time we finish animation, another drag/drop session may have |
| 501 // started. We do not want to destroy the drag image in that case. | 501 // started. We do not want to destroy the drag image in that case. |
| 502 if (!IsDragDropInProgress()) | 502 if (!IsDragDropInProgress()) |
| 503 drag_image_.reset(); | 503 drag_image_.reset(); |
| 504 if (pending_long_tap_) { | 504 if (pending_long_tap_) { |
| 505 // If not in a nested message loop, we can forward the long tap right now. | 505 // If not in a nested run loop, we can forward the long tap right now. |
| 506 if (!should_block_during_drag_drop_) { | 506 if (!should_block_during_drag_drop_) { |
| 507 ForwardPendingLongTap(); | 507 ForwardPendingLongTap(); |
| 508 } else { | 508 } else { |
| 509 // See comment about this in OnGestureEvent(). | 509 // See comment about this in OnGestureEvent(). |
| 510 base::ThreadTaskRunnerHandle::Get()->PostTask( | 510 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 511 FROM_HERE, base::Bind(&DragDropController::ForwardPendingLongTap, | 511 FROM_HERE, base::Bind(&DragDropController::ForwardPendingLongTap, |
| 512 weak_factory_.GetWeakPtr())); | 512 weak_factory_.GetWeakPtr())); |
| 513 } | 513 } |
| 514 } | 514 } |
| 515 } | 515 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (drag_window_) | 575 if (drag_window_) |
| 576 drag_window_->RemoveObserver(this); | 576 drag_window_->RemoveObserver(this); |
| 577 drag_window_ = NULL; | 577 drag_window_ = NULL; |
| 578 drag_data_ = NULL; | 578 drag_data_ = NULL; |
| 579 // Cleanup can be called again while deleting DragDropTracker, so delete | 579 // Cleanup can be called again while deleting DragDropTracker, so delete |
| 580 // the pointer with a local variable to avoid double free. | 580 // the pointer with a local variable to avoid double free. |
| 581 std::unique_ptr<ash::DragDropTracker> holder = std::move(drag_drop_tracker_); | 581 std::unique_ptr<ash::DragDropTracker> holder = std::move(drag_drop_tracker_); |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace ash | 584 } // namespace ash |
| OLD | NEW |