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/display/mouse_cursor_event_filter.h" | 7 #include "ash/display/mouse_cursor_event_filter.h" |
8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 ShelfLayoutManager* shelf_layout_manager() { | 135 ShelfLayoutManager* shelf_layout_manager() { |
136 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); | 136 return Shell::GetPrimaryRootWindowController()->GetShelfLayoutManager(); |
137 } | 137 } |
138 | 138 |
139 static WindowResizer* CreateDragWindowResizer( | 139 static WindowResizer* CreateDragWindowResizer( |
140 aura::Window* window, | 140 aura::Window* window, |
141 const gfx::Point& point_in_parent, | 141 const gfx::Point& point_in_parent, |
142 int window_component) { | 142 int window_component) { |
143 return CreateWindowResizer(WmWindow::Get(window), point_in_parent, | 143 return CreateWindowResizer(window, point_in_parent, window_component, |
144 window_component, | |
145 aura::client::WINDOW_MOVE_SOURCE_MOUSE) | 144 aura::client::WINDOW_MOVE_SOURCE_MOUSE) |
146 .release(); | 145 .release(); |
147 } | 146 } |
148 | 147 |
149 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { | 148 bool TestIfMouseWarpsAt(const gfx::Point& point_in_screen) { |
150 return test::AshTestBase::TestIfMouseWarpsAt(GetEventGenerator(), | 149 return test::AshTestBase::TestIfMouseWarpsAt(GetEventGenerator(), |
151 point_in_screen); | 150 point_in_screen); |
152 } | 151 } |
153 | 152 |
154 aura::test::TestWindowDelegate delegate_; | 153 aura::test::TestWindowDelegate delegate_; |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 ASSERT_TRUE(resizer.get()); | 742 ASSERT_TRUE(resizer.get()); |
744 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); | 743 resizer->Drag(CalculateDragPoint(*resizer, 399, 200), 0); |
745 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); | 744 EXPECT_TRUE(TestIfMouseWarpsAt(gfx::Point(399, 200))); |
746 EXPECT_EQ("401,200", | 745 EXPECT_EQ("401,200", |
747 aura::Env::GetInstance()->last_mouse_location().ToString()); | 746 aura::Env::GetInstance()->last_mouse_location().ToString()); |
748 resizer->CompleteDrag(); | 747 resizer->CompleteDrag(); |
749 } | 748 } |
750 } | 749 } |
751 | 750 |
752 } // namespace ash | 751 } // namespace ash |
OLD | NEW |