OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <map> | 5 #include <map> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 // Include views_test_base.h first because the definition of None in X.h | 8 // Include views_test_base.h first because the definition of None in X.h |
9 // conflicts with the definition of None in gtest-type-util.h | 9 // conflicts with the definition of None in gtest-type-util.h |
10 #include "ui/views/test/views_test_base.h" | 10 #include "ui/views/test/views_test_base.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 virtual ~TestMoveLoop(); | 83 virtual ~TestMoveLoop(); |
84 | 84 |
85 // Returns true if the move loop is running. | 85 // Returns true if the move loop is running. |
86 bool IsRunning() const; | 86 bool IsRunning() const; |
87 | 87 |
88 // X11MoveLoop: | 88 // X11MoveLoop: |
89 virtual bool RunMoveLoop(aura::Window* window, | 89 virtual bool RunMoveLoop(aura::Window* window, |
90 gfx::NativeCursor cursor) OVERRIDE; | 90 gfx::NativeCursor cursor) OVERRIDE; |
91 virtual void UpdateCursor(gfx::NativeCursor cursor) OVERRIDE; | 91 virtual void UpdateCursor(gfx::NativeCursor cursor) OVERRIDE; |
92 virtual void EndMoveLoop() OVERRIDE; | 92 virtual void EndMoveLoop() OVERRIDE; |
93 virtual void SetDragImage(const gfx::ImageSkia& image, | |
94 const gfx::Vector2dF& offset) OVERRIDE; | |
95 | 93 |
96 private: | 94 private: |
97 // Not owned. | 95 // Not owned. |
98 X11MoveLoopDelegate* delegate_; | 96 X11MoveLoopDelegate* delegate_; |
99 | 97 |
100 // Ends the move loop. | 98 // Ends the move loop. |
101 base::Closure quit_closure_; | 99 base::Closure quit_closure_; |
102 | 100 |
103 bool is_running_; | 101 bool is_running_; |
104 }; | 102 }; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 231 } |
234 | 232 |
235 void TestMoveLoop::EndMoveLoop() { | 233 void TestMoveLoop::EndMoveLoop() { |
236 if (is_running_) { | 234 if (is_running_) { |
237 delegate_->OnMoveLoopEnded(); | 235 delegate_->OnMoveLoopEnded(); |
238 is_running_ = false; | 236 is_running_ = false; |
239 quit_closure_.Run(); | 237 quit_closure_.Run(); |
240 } | 238 } |
241 } | 239 } |
242 | 240 |
243 void TestMoveLoop::SetDragImage(const gfx::ImageSkia& image, | |
244 const gfx::Vector2dF& offset) { | |
245 } | |
246 | |
247 /////////////////////////////////////////////////////////////////////////////// | 241 /////////////////////////////////////////////////////////////////////////////// |
248 // TestDragDropClient | 242 // TestDragDropClient |
249 | 243 |
250 // static | 244 // static |
251 const int TestDragDropClient::kMouseMoveX = 100; | 245 const int TestDragDropClient::kMouseMoveX = 100; |
252 | 246 |
253 // static | 247 // static |
254 const int TestDragDropClient::kMouseMoveY = 200; | 248 const int TestDragDropClient::kMouseMoveY = 200; |
255 | 249 |
256 TestDragDropClient::TestDragDropClient( | 250 TestDragDropClient::TestDragDropClient( |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 | 716 |
723 // Repeat the test but reject the drop in the XdndFinished message instead. | 717 // Repeat the test but reject the drop in the XdndFinished message instead. |
724 base::MessageLoop::current()->PostTask( | 718 base::MessageLoop::current()->PostTask( |
725 FROM_HERE, | 719 FROM_HERE, |
726 base::Bind(&RejectAfterMouseReleaseStep3, client())); | 720 base::Bind(&RejectAfterMouseReleaseStep3, client())); |
727 result = StartDragAndDrop(); | 721 result = StartDragAndDrop(); |
728 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); | 722 EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, result); |
729 } | 723 } |
730 | 724 |
731 } // namespace views | 725 } // namespace views |
OLD | NEW |