Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: ash/drag_drop/drag_drop_controller.cc

Issue 11031026: Remove RootWindow reference from DragDropTracker. RootWindow reference in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/drag_drop/drag_drop_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(const ui::OSExchangeData& data,
60 aura::RootWindow* root_window, 60 aura::RootWindow* root_window,
61 const gfx::Point& root_location, 61 const gfx::Point& root_location,
62 int operation) { 62 int operation) {
63 DCHECK(!IsDragDropInProgress()); 63 DCHECK(!IsDragDropInProgress());
64 64
65 drag_drop_tracker_.reset(new DragDropTracker(root_window)); 65 drag_drop_tracker_.reset(new DragDropTracker);
66 66
67 drag_data_ = &data; 67 drag_data_ = &data;
68 drag_operation_ = operation; 68 drag_operation_ = operation;
69 const ui::OSExchangeDataProviderAura& provider = 69 const ui::OSExchangeDataProviderAura& provider =
70 static_cast<const ui::OSExchangeDataProviderAura&>(data.provider()); 70 static_cast<const ui::OSExchangeDataProviderAura&>(data.provider());
71 71
72 drag_image_.reset(new DragImageView); 72 drag_image_.reset(new DragImageView);
73 drag_image_->SetImage(provider.drag_image()); 73 drag_image_->SetImage(provider.drag_image());
74 drag_image_offset_ = provider.drag_image_offset(); 74 drag_image_offset_ = provider.drag_image_offset();
75 drag_image_->SetBoundsInScreen(gfx::Rect( 75 drag_image_->SetBoundsInScreen(gfx::Rect(
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 drag_window_->RemoveObserver(this); 298 drag_window_->RemoveObserver(this);
299 drag_window_ = NULL; 299 drag_window_ = NULL;
300 drag_data_ = NULL; 300 drag_data_ = NULL;
301 // Cleanup can be called again while deleting DragDropTracker, so use Pass 301 // Cleanup can be called again while deleting DragDropTracker, so use Pass
302 // instead of reset to avoid double free. 302 // instead of reset to avoid double free.
303 drag_drop_tracker_.Pass(); 303 drag_drop_tracker_.Pass();
304 } 304 }
305 305
306 } // namespace internal 306 } // namespace internal
307 } // namespace ash 307 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/drag_drop/drag_drop_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698