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/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 141 } |
142 | 142 |
143 void Complete() { | 143 void Complete() { |
144 Step(start_time() + base::TimeDelta::FromMilliseconds(duration_)); | 144 Step(start_time() + base::TimeDelta::FromMilliseconds(duration_)); |
145 } | 145 } |
146 | 146 |
147 private: | 147 private: |
148 int duration_; | 148 int duration_; |
149 }; | 149 }; |
150 | 150 |
151 class TestDragDropController : public internal::DragDropController { | 151 class TestDragDropController : public DragDropController { |
152 public: | 152 public: |
153 TestDragDropController() : internal::DragDropController() { | 153 TestDragDropController() : DragDropController() { Reset(); } |
154 Reset(); | |
155 } | |
156 | 154 |
157 void Reset() { | 155 void Reset() { |
158 drag_start_received_ = false; | 156 drag_start_received_ = false; |
159 num_drag_updates_ = 0; | 157 num_drag_updates_ = 0; |
160 drop_received_ = false; | 158 drop_received_ = false; |
161 drag_canceled_ = false; | 159 drag_canceled_ = false; |
162 drag_string_.clear(); | 160 drag_string_.clear(); |
163 } | 161 } |
164 | 162 |
165 virtual int StartDragAndDrop( | 163 virtual int StartDragAndDrop( |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 drag_drop_controller_->drag_source_window_ = drag_source_window; | 324 drag_drop_controller_->drag_source_window_ = drag_source_window; |
327 drag_source_window->AddObserver(drag_drop_controller_.get()); | 325 drag_source_window->AddObserver(drag_drop_controller_.get()); |
328 } | 326 } |
329 | 327 |
330 aura::Window* GetDragImageWindow() { | 328 aura::Window* GetDragImageWindow() { |
331 return drag_drop_controller_->drag_image_.get() ? | 329 return drag_drop_controller_->drag_image_.get() ? |
332 drag_drop_controller_->drag_image_->GetWidget()->GetNativeWindow() : | 330 drag_drop_controller_->drag_image_->GetWidget()->GetNativeWindow() : |
333 NULL; | 331 NULL; |
334 } | 332 } |
335 | 333 |
336 internal::DragDropTracker* drag_drop_tracker() { | 334 DragDropTracker* drag_drop_tracker() { |
337 return drag_drop_controller_->drag_drop_tracker_.get(); | 335 return drag_drop_controller_->drag_drop_tracker_.get(); |
338 } | 336 } |
339 | 337 |
340 void CompleteCancelAnimation() { | 338 void CompleteCancelAnimation() { |
341 CompletableLinearAnimation* animation = | 339 CompletableLinearAnimation* animation = |
342 static_cast<CompletableLinearAnimation*>( | 340 static_cast<CompletableLinearAnimation*>( |
343 drag_drop_controller_->cancel_animation_.get()); | 341 drag_drop_controller_->cancel_animation_.get()); |
344 animation->Complete(); | 342 animation->Complete(); |
345 } | 343 } |
346 | 344 |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); | 1078 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); |
1081 } | 1079 } |
1082 for (aura::Window::Windows::iterator iter = root_windows.begin(); | 1080 for (aura::Window::Windows::iterator iter = root_windows.begin(); |
1083 iter != root_windows.end(); ++iter) { | 1081 iter != root_windows.end(); ++iter) { |
1084 aura::client::SetDragDropClient(*iter, NULL); | 1082 aura::client::SetDragDropClient(*iter, NULL); |
1085 } | 1083 } |
1086 } | 1084 } |
1087 | 1085 |
1088 } // namespace test | 1086 } // namespace test |
1089 } // namespace aura | 1087 } // namespace aura |
OLD | NEW |