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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 drag_image_offset_.y() + drag_image_vertical_offset)); | 221 drag_image_offset_.y() + drag_image_vertical_offset)); |
222 } | 222 } |
223 | 223 |
224 drag_window_ = NULL; | 224 drag_window_ = NULL; |
225 | 225 |
226 // Ends cancel animation if it's in progress. | 226 // Ends cancel animation if it's in progress. |
227 if (cancel_animation_) | 227 if (cancel_animation_) |
228 cancel_animation_->End(); | 228 cancel_animation_->End(); |
229 | 229 |
230 if (should_block_during_drag_drop_) { | 230 if (should_block_during_drag_drop_) { |
231 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 231 base::RunLoop run_loop; |
232 quit_closure_ = run_loop.QuitClosure(); | 232 quit_closure_ = run_loop.QuitClosure(); |
233 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); | 233 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); |
234 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); | 234 base::MessageLoop::ScopedNestableTaskAllower allow_nested(loop); |
235 run_loop.Run(); | 235 run_loop.Run(); |
236 } | 236 } |
237 | 237 |
238 if (!cancel_animation_.get() || !cancel_animation_->is_animating() || | 238 if (!cancel_animation_.get() || !cancel_animation_->is_animating() || |
239 !pending_long_tap_.get()) { | 239 !pending_long_tap_.get()) { |
240 // If drag cancel animation is running, this cleanup is done when the | 240 // If drag cancel animation is running, this cleanup is done when the |
241 // animation completes. | 241 // animation completes. |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 drag_window_->RemoveObserver(this); | 557 drag_window_->RemoveObserver(this); |
558 drag_window_ = NULL; | 558 drag_window_ = NULL; |
559 drag_data_ = NULL; | 559 drag_data_ = NULL; |
560 // Cleanup can be called again while deleting DragDropTracker, so use Pass | 560 // Cleanup can be called again while deleting DragDropTracker, so use Pass |
561 // instead of reset to avoid double free. | 561 // instead of reset to avoid double free. |
562 drag_drop_tracker_.Pass(); | 562 drag_drop_tracker_.Pass(); |
563 } | 563 } |
564 | 564 |
565 } // namespace internal | 565 } // namespace internal |
566 } // namespace ash | 566 } // namespace ash |
OLD | NEW |