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