| 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 static_cast<aura::Window*>(drag_source_window_))); | 454 static_cast<aura::Window*>(drag_source_window_))); |
| 455 DoDragCancel(kTouchCancelAnimationDuration); | 455 DoDragCancel(kTouchCancelAnimationDuration); |
| 456 break; | 456 break; |
| 457 default: | 457 default: |
| 458 break; | 458 break; |
| 459 } | 459 } |
| 460 event->SetHandled(); | 460 event->SetHandled(); |
| 461 } | 461 } |
| 462 | 462 |
| 463 void DragDropController::OnWindowDestroyed(aura::Window* window) { | 463 void DragDropController::OnWindowDestroyed(aura::Window* window) { |
| 464 if (drag_window_ == window) { | 464 if (drag_window_ == window) |
| 465 drag_window_->RemoveObserver(this); | |
| 466 drag_window_ = NULL; | 465 drag_window_ = NULL; |
| 467 } | 466 if (drag_source_window_ == window) |
| 468 if (drag_source_window_ == window) { | |
| 469 drag_source_window_->RemoveObserver(this); | |
| 470 drag_source_window_ = NULL; | 467 drag_source_window_ = NULL; |
| 471 } | |
| 472 } | 468 } |
| 473 | 469 |
| 474 //////////////////////////////////////////////////////////////////////////////// | 470 //////////////////////////////////////////////////////////////////////////////// |
| 475 // DragDropController, protected: | 471 // DragDropController, protected: |
| 476 | 472 |
| 477 gfx::LinearAnimation* DragDropController::CreateCancelAnimation( | 473 gfx::LinearAnimation* DragDropController::CreateCancelAnimation( |
| 478 int duration, | 474 int duration, |
| 479 int frame_rate, | 475 int frame_rate, |
| 480 gfx::AnimationDelegate* delegate) { | 476 gfx::AnimationDelegate* delegate) { |
| 481 return new gfx::LinearAnimation(duration, frame_rate, delegate); | 477 return new gfx::LinearAnimation(duration, frame_rate, delegate); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 drag_window_->RemoveObserver(this); | 557 drag_window_->RemoveObserver(this); |
| 562 drag_window_ = NULL; | 558 drag_window_ = NULL; |
| 563 drag_data_ = NULL; | 559 drag_data_ = NULL; |
| 564 // Cleanup can be called again while deleting DragDropTracker, so use Pass | 560 // Cleanup can be called again while deleting DragDropTracker, so use Pass |
| 565 // instead of reset to avoid double free. | 561 // instead of reset to avoid double free. |
| 566 drag_drop_tracker_.Pass(); | 562 drag_drop_tracker_.Pass(); |
| 567 } | 563 } |
| 568 | 564 |
| 569 } // namespace internal | 565 } // namespace internal |
| 570 } // namespace ash | 566 } // namespace ash |
| OLD | NEW |