| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 const gfx::Point& location, | 131 const gfx::Point& location, |
| 132 int operation) OVERRIDE { | 132 int operation, |
| 133 ui::DragDropTypes::DragEventSource source) 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( | 136 return DragDropController::StartDragAndDrop( |
| 136 data, root_window, location, operation); | 137 data, root_window, location, operation, source); |
| 137 } | 138 } |
| 138 | 139 |
| 139 void DragUpdate(aura::Window* target, | 140 void DragUpdate(aura::Window* target, |
| 140 const ui::LocatedEvent& event) OVERRIDE { | 141 const ui::LocatedEvent& event) OVERRIDE { |
| 141 DragDropController::DragUpdate(target, event); | 142 DragDropController::DragUpdate(target, event); |
| 142 num_drag_updates_++; | 143 num_drag_updates_++; |
| 143 } | 144 } |
| 144 | 145 |
| 145 void Drop(aura::Window* target, const ui::LocatedEvent& event) OVERRIDE { | 146 void Drop(aura::Window* target, const ui::LocatedEvent& event) OVERRIDE { |
| 146 DragDropController::Drop(target, event); | 147 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_); | 671 EXPECT_EQ(1, drag_view->num_drag_enters_); |
| 671 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), | 672 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), |
| 672 drag_view->num_drag_updates_); | 673 drag_view->num_drag_updates_); |
| 673 EXPECT_EQ(0, drag_view->num_drops_); | 674 EXPECT_EQ(0, drag_view->num_drops_); |
| 674 EXPECT_EQ(1, drag_view->num_drag_exits_); | 675 EXPECT_EQ(1, drag_view->num_drag_exits_); |
| 675 EXPECT_TRUE(drag_view->drag_done_received_); | 676 EXPECT_TRUE(drag_view->drag_done_received_); |
| 676 } | 677 } |
| 677 | 678 |
| 678 } // namespace test | 679 } // namespace test |
| 679 } // namespace aura | 680 } // namespace aura |
| OLD | NEW |