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/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } | 121 } |
122 | 122 |
123 bool drag_start_received_; | 123 bool drag_start_received_; |
124 int num_drag_updates_; | 124 int num_drag_updates_; |
125 bool drop_received_; | 125 bool drop_received_; |
126 bool drag_canceled_; | 126 bool drag_canceled_; |
127 string16 drag_string_; | 127 string16 drag_string_; |
128 | 128 |
129 private: | 129 private: |
130 int StartDragAndDrop(const ui::OSExchangeData& data, | 130 int StartDragAndDrop(const ui::OSExchangeData& data, |
| 131 aura::RootWindow* root_window, |
131 const gfx::Point& location, | 132 const gfx::Point& location, |
132 int operation) OVERRIDE { | 133 int operation) OVERRIDE { |
133 drag_start_received_ = true; | 134 drag_start_received_ = true; |
134 data.GetString(&drag_string_); | 135 data.GetString(&drag_string_); |
135 return DragDropController::StartDragAndDrop(data, location, operation); | 136 return DragDropController::StartDragAndDrop( |
| 137 data, root_window, location, operation); |
136 } | 138 } |
137 | 139 |
138 void DragUpdate(aura::Window* target, | 140 void DragUpdate(aura::Window* target, |
139 const ui::LocatedEvent& event) OVERRIDE { | 141 const ui::LocatedEvent& event) OVERRIDE { |
140 DragDropController::DragUpdate(target, event); | 142 DragDropController::DragUpdate(target, event); |
141 num_drag_updates_++; | 143 num_drag_updates_++; |
142 } | 144 } |
143 | 145 |
144 void Drop(aura::Window* target, const ui::LocatedEvent& event) OVERRIDE { | 146 void Drop(aura::Window* target, const ui::LocatedEvent& event) OVERRIDE { |
145 DragDropController::Drop(target, event); | 147 DragDropController::Drop(target, event); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 EXPECT_EQ(1, drag_view->num_drag_enters_); | 668 EXPECT_EQ(1, drag_view->num_drag_enters_); |
667 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), | 669 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), |
668 drag_view->num_drag_updates_); | 670 drag_view->num_drag_updates_); |
669 EXPECT_EQ(0, drag_view->num_drops_); | 671 EXPECT_EQ(0, drag_view->num_drops_); |
670 EXPECT_EQ(1, drag_view->num_drag_exits_); | 672 EXPECT_EQ(1, drag_view->num_drag_exits_); |
671 EXPECT_TRUE(drag_view->drag_done_received_); | 673 EXPECT_TRUE(drag_view->drag_done_received_); |
672 } | 674 } |
673 | 675 |
674 } // namespace test | 676 } // namespace test |
675 } // namespace aura | 677 } // namespace aura |
OLD | NEW |