| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 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 const gfx::Point& location, | 131 const gfx::Point& location, |
| 131 int operation) OVERRIDE { | 132 int operation) OVERRIDE { |
| 132 drag_start_received_ = true; | 133 drag_start_received_ = true; |
| 133 data.GetString(&drag_string_); | 134 data.GetString(&drag_string_); |
| 134 return DragDropController::StartDragAndDrop(data, location, operation); | 135 return DragDropController::StartDragAndDrop( |
| 136 data, root_window, location, operation); |
| 135 } | 137 } |
| 136 | 138 |
| 137 void DragUpdate(aura::Window* target, | 139 void DragUpdate(aura::Window* target, |
| 138 const ui::LocatedEvent& event) OVERRIDE { | 140 const ui::LocatedEvent& event) OVERRIDE { |
| 139 DragDropController::DragUpdate(target, event); | 141 DragDropController::DragUpdate(target, event); |
| 140 num_drag_updates_++; | 142 num_drag_updates_++; |
| 141 } | 143 } |
| 142 | 144 |
| 143 void Drop(aura::Window* target, const ui::LocatedEvent& event) OVERRIDE { | 145 void Drop(aura::Window* target, const ui::LocatedEvent& event) OVERRIDE { |
| 144 DragDropController::Drop(target, event); | 146 DragDropController::Drop(target, event); |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 EXPECT_EQ(1, drag_view->num_drag_enters_); | 667 EXPECT_EQ(1, drag_view->num_drag_enters_); |
| 666 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), | 668 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), |
| 667 drag_view->num_drag_updates_); | 669 drag_view->num_drag_updates_); |
| 668 EXPECT_EQ(0, drag_view->num_drops_); | 670 EXPECT_EQ(0, drag_view->num_drops_); |
| 669 EXPECT_EQ(1, drag_view->num_drag_exits_); | 671 EXPECT_EQ(1, drag_view->num_drag_exits_); |
| 670 EXPECT_TRUE(drag_view->drag_done_received_); | 672 EXPECT_TRUE(drag_view->drag_done_received_); |
| 671 } | 673 } |
| 672 | 674 |
| 673 } // namespace test | 675 } // namespace test |
| 674 } // namespace aura | 676 } // namespace aura |
| OLD | NEW |