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

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

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 #ifndef ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ 5 #ifndef ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_
6 #define ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ 6 #define ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_
7 7
oshima 2016/04/08 07:09:40 include?
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "ui/aura/window_observer.h" 12 #include "ui/aura/window_observer.h"
13 #include "ui/base/dragdrop/os_exchange_data.h" 13 #include "ui/base/dragdrop/os_exchange_data.h"
14 #include "ui/events/event_constants.h" 14 #include "ui/events/event_constants.h"
15 #include "ui/events/event_handler.h" 15 #include "ui/events/event_handler.h"
16 #include "ui/gfx/animation/animation_delegate.h" 16 #include "ui/gfx/animation/animation_delegate.h"
17 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 // Helper method to start drag widget flying back animation. 87 // Helper method to start drag widget flying back animation.
88 void StartCanceledAnimation(int animation_duration_ms); 88 void StartCanceledAnimation(int animation_duration_ms);
89 89
90 // Helper method to forward |pending_log_tap_| event to |drag_source_window_|. 90 // Helper method to forward |pending_log_tap_| event to |drag_source_window_|.
91 void ForwardPendingLongTap(); 91 void ForwardPendingLongTap();
92 92
93 // Helper method to reset everything. 93 // Helper method to reset everything.
94 void Cleanup(); 94 void Cleanup();
95 95
96 scoped_ptr<DragImageView> drag_image_; 96 std::unique_ptr<DragImageView> drag_image_;
97 gfx::Vector2d drag_image_offset_; 97 gfx::Vector2d drag_image_offset_;
98 const ui::OSExchangeData* drag_data_; 98 const ui::OSExchangeData* drag_data_;
99 int drag_operation_; 99 int drag_operation_;
100 100
101 // Window that is currently under the drag cursor. 101 // Window that is currently under the drag cursor.
102 aura::Window* drag_window_; 102 aura::Window* drag_window_;
103 103
104 // Starting and final bounds for the drag image for the drag cancel animation. 104 // Starting and final bounds for the drag image for the drag cancel animation.
105 gfx::Rect drag_image_initial_bounds_for_cancel_animation_; 105 gfx::Rect drag_image_initial_bounds_for_cancel_animation_;
106 gfx::Rect drag_image_final_bounds_for_cancel_animation_; 106 gfx::Rect drag_image_final_bounds_for_cancel_animation_;
107 107
108 scoped_ptr<gfx::LinearAnimation> cancel_animation_; 108 std::unique_ptr<gfx::LinearAnimation> cancel_animation_;
109 109
110 // Window that started the drag. 110 // Window that started the drag.
111 aura::Window* drag_source_window_; 111 aura::Window* drag_source_window_;
112 112
113 // Indicates whether the caller should be blocked on a drag/drop session. 113 // Indicates whether the caller should be blocked on a drag/drop session.
114 // Only be used for tests. 114 // Only be used for tests.
115 bool should_block_during_drag_drop_; 115 bool should_block_during_drag_drop_;
116 116
117 // Closure for quitting nested message loop. 117 // Closure for quitting nested message loop.
118 base::Closure quit_closure_; 118 base::Closure quit_closure_;
119 119
120 scoped_ptr<ash::DragDropTracker> drag_drop_tracker_; 120 std::unique_ptr<ash::DragDropTracker> drag_drop_tracker_;
121 scoped_ptr<DragDropTrackerDelegate> drag_drop_window_delegate_; 121 std::unique_ptr<DragDropTrackerDelegate> drag_drop_window_delegate_;
122 122
123 ui::DragDropTypes::DragEventSource current_drag_event_source_; 123 ui::DragDropTypes::DragEventSource current_drag_event_source_;
124 124
125 // Holds a synthetic long tap event to be sent to the |drag_source_window_|. 125 // Holds a synthetic long tap event to be sent to the |drag_source_window_|.
126 // See comment in OnGestureEvent() on why we need this. 126 // See comment in OnGestureEvent() on why we need this.
127 scoped_ptr<ui::GestureEvent> pending_long_tap_; 127 std::unique_ptr<ui::GestureEvent> pending_long_tap_;
128 128
129 base::WeakPtrFactory<DragDropController> weak_factory_; 129 base::WeakPtrFactory<DragDropController> weak_factory_;
130 130
131 DISALLOW_COPY_AND_ASSIGN(DragDropController); 131 DISALLOW_COPY_AND_ASSIGN(DragDropController);
132 }; 132 };
133 133
134 } // namespace ash 134 } // namespace ash
135 135
136 #endif // ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ 136 #endif // ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698