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/wm/drag_window_resizer.h" | 5 #include "ash/wm/drag_window_resizer.h" |
6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" |
7 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
8 #include "ash/common/wm/window_positioning_utils.h" | 9 #include "ash/common/wm/window_positioning_utils.h" |
9 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
10 #include "ash/display/mouse_cursor_event_filter.h" | 11 #include "ash/display/mouse_cursor_event_filter.h" |
11 #include "ash/root_window_controller.h" | 12 #include "ash/root_window_controller.h" |
12 #include "ash/shelf/shelf_layout_manager.h" | 13 #include "ash/shelf/shelf_layout_manager.h" |
13 #include "ash/shell.h" | 14 #include "ash/shell.h" |
14 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
15 #include "ash/test/cursor_manager_test_api.h" | 16 #include "ash/test/cursor_manager_test_api.h" |
16 #include "ash/test/display_manager_test_api.h" | 17 #include "ash/test/display_manager_test_api.h" |
17 #include "ash/wm/aura/wm_window_aura.h" | |
18 #include "ash/wm/drag_window_controller.h" | 18 #include "ash/wm/drag_window_controller.h" |
19 #include "ash/wm/window_util.h" | 19 #include "ash/wm/window_util.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
22 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
23 #include "ui/aura/env.h" | 23 #include "ui/aura/env.h" |
24 #include "ui/aura/test/test_window_delegate.h" | 24 #include "ui/aura/test/test_window_delegate.h" |
25 #include "ui/base/hit_test.h" | 25 #include "ui/base/hit_test.h" |
26 #include "ui/base/ui_base_types.h" | 26 #include "ui/base/ui_base_types.h" |
27 #include "ui/compositor/layer_delegate.h" | 27 #include "ui/compositor/layer_delegate.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } | 137 } |
138 | 138 |
139 ShelfLayoutManager* shelf_layout_manager() { | 139 ShelfLayoutManager* shelf_layout_manager() { |
140 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); | 140 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); |
141 } | 141 } |
142 | 142 |
143 static WindowResizer* CreateDragWindowResizer( | 143 static WindowResizer* CreateDragWindowResizer( |
144 aura::Window* window, | 144 aura::Window* window, |
145 const gfx::Point& point_in_parent, | 145 const gfx::Point& point_in_parent, |
146 int window_component) { | 146 int window_component) { |
147 return CreateWindowResizer(wm::WmWindowAura::Get(window), point_in_parent, | 147 return CreateWindowResizer(WmWindowAura::Get(window), point_in_parent, |
148 window_component, | 148 window_component, |
149 aura::client::WINDOW_MOVE_SOURCE_MOUSE) | 149 aura::client::WINDOW_MOVE_SOURCE_MOUSE) |
150 .release(); | 150 .release(); |
151 } | 151 } |
152 | 152 |
153 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { | 153 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { |
154 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), | 154 return test::DisplayManagerTestApi::TestIfMouseWarpsAt(GetEventGenerator(), |
155 point_in_screen); | 155 point_in_screen); |
156 } | 156 } |
157 | 157 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 ASSERT_TRUE(resizer.get()); | 769 ASSERT_TRUE(resizer.get()); |
770 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); | 770 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); |
771 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); | 771 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); |
772 EXPECT_EQ("401,200", | 772 EXPECT_EQ("401,200", |
773 aura::Env::GetInstance()->last_mouse_location().ToString()); | 773 aura::Env::GetInstance()->last_mouse_location().ToString()); |
774 resizer->CompleteDrag(); | 774 resizer->CompleteDrag(); |
775 } | 775 } |
776 } | 776 } |
777 | 777 |
778 } // namespace ash | 778 } // namespace ash |
OLD | NEW |