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> |
| 8 |
7 #include "ash/drag_drop/drag_drop_tracker.h" | 9 #include "ash/drag_drop/drag_drop_tracker.h" |
8 #include "ash/drag_drop/drag_image_view.h" | 10 #include "ash/drag_drop/drag_image_view.h" |
9 #include "ash/shell.h" | 11 #include "ash/shell.h" |
10 #include "base/bind.h" | 12 #include "base/bind.h" |
11 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
12 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
13 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
14 #include "ui/aura/client/capture_client.h" | 16 #include "ui/aura/client/capture_client.h" |
15 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
16 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 drag_source_window_ = NULL; | 560 drag_source_window_ = NULL; |
559 } | 561 } |
560 | 562 |
561 void DragDropController::Cleanup() { | 563 void DragDropController::Cleanup() { |
562 if (drag_window_) | 564 if (drag_window_) |
563 drag_window_->RemoveObserver(this); | 565 drag_window_->RemoveObserver(this); |
564 drag_window_ = NULL; | 566 drag_window_ = NULL; |
565 drag_data_ = NULL; | 567 drag_data_ = NULL; |
566 // Cleanup can be called again while deleting DragDropTracker, so delete | 568 // Cleanup can be called again while deleting DragDropTracker, so delete |
567 // the pointer with a local variable to avoid double free. | 569 // the pointer with a local variable to avoid double free. |
568 scoped_ptr<ash::DragDropTracker> holder = drag_drop_tracker_.Pass(); | 570 scoped_ptr<ash::DragDropTracker> holder = std::move(drag_drop_tracker_); |
569 } | 571 } |
570 | 572 |
571 } // namespace ash | 573 } // namespace ash |
OLD | NEW |