| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dock/docked_window_resizer.h" | 5 #include "ash/wm/dock/docked_window_resizer.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| 11 #include "ash/shelf/shelf.h" | 11 #include "ash/shelf/shelf.h" |
| 12 #include "ash/shelf/shelf_layout_manager.h" | 12 #include "ash/shelf/shelf_layout_manager.h" |
| 13 #include "ash/shelf/shelf_model.h" | 13 #include "ash/shelf/shelf_model.h" |
| 14 #include "ash/shelf/shelf_types.h" | 14 #include "ash/shelf/shelf_types.h" |
| 15 #include "ash/shelf/shelf_widget.h" | 15 #include "ash/shelf/shelf_widget.h" |
| 16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 17 #include "ash/shell_window_ids.h" | 17 #include "ash/shell_window_ids.h" |
| 18 #include "ash/test/ash_test_base.h" | 18 #include "ash/test/ash_test_base.h" |
| 19 #include "ash/test/cursor_manager_test_api.h" | 19 #include "ash/test/cursor_manager_test_api.h" |
| 20 #include "ash/test/shell_test_api.h" | 20 #include "ash/test/shell_test_api.h" |
| 21 #include "ash/test/test_shelf_delegate.h" | 21 #include "ash/test/test_shelf_delegate.h" |
| 22 #include "ash/wm/aura/wm_window_aura.h" |
| 22 #include "ash/wm/common/wm_event.h" | 23 #include "ash/wm/common/wm_event.h" |
| 23 #include "ash/wm/dock/docked_window_layout_manager.h" | 24 #include "ash/wm/dock/docked_window_layout_manager.h" |
| 24 #include "ash/wm/drag_window_resizer.h" | 25 #include "ash/wm/drag_window_resizer.h" |
| 25 #include "ash/wm/panels/panel_layout_manager.h" | 26 #include "ash/wm/panels/panel_layout_manager.h" |
| 26 #include "ash/wm/window_state.h" | 27 #include "ash/wm/window_state.h" |
| 27 #include "ash/wm/window_state_aura.h" | 28 #include "ash/wm/window_state_aura.h" |
| 28 #include "ash/wm/window_util.h" | 29 #include "ash/wm/window_util.h" |
| 29 #include "base/command_line.h" | 30 #include "base/command_line.h" |
| 30 #include "ui/aura/client/aura_constants.h" | 31 #include "ui/aura/client/aura_constants.h" |
| 31 #include "ui/aura/client/window_tree_client.h" | 32 #include "ui/aura/client/window_tree_client.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 window->SetBounds(gfx::Rect(origin, bounds.size())); | 111 window->SetBounds(gfx::Rect(origin, bounds.size())); |
| 111 aura::client::ParentWindowWithContext(window, root, bounds); | 112 aura::client::ParentWindowWithContext(window, root, bounds); |
| 112 } | 113 } |
| 113 return window; | 114 return window; |
| 114 } | 115 } |
| 115 | 116 |
| 116 static WindowResizer* CreateSomeWindowResizer( | 117 static WindowResizer* CreateSomeWindowResizer( |
| 117 aura::Window* window, | 118 aura::Window* window, |
| 118 const gfx::Point& point_in_parent, | 119 const gfx::Point& point_in_parent, |
| 119 int window_component) { | 120 int window_component) { |
| 120 return CreateWindowResizer( | 121 return CreateWindowResizer(wm::WmWindowAura::Get(window), point_in_parent, |
| 121 window, | 122 window_component, |
| 122 point_in_parent, | 123 aura::client::WINDOW_MOVE_SOURCE_MOUSE) |
| 123 window_component, | 124 .release(); |
| 124 aura::client::WINDOW_MOVE_SOURCE_MOUSE).release(); | |
| 125 } | 125 } |
| 126 | 126 |
| 127 void DragStart(aura::Window* window) { | 127 void DragStart(aura::Window* window) { |
| 128 DragStartAtOffsetFromWindowOrigin(window, 0, 0); | 128 DragStartAtOffsetFromWindowOrigin(window, 0, 0); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void DragStartAtOffsetFromWindowOrigin(aura::Window* window, | 131 void DragStartAtOffsetFromWindowOrigin(aura::Window* window, |
| 132 int dx, int dy) { | 132 int dx, int dy) { |
| 133 initial_location_in_parent_ = | 133 initial_location_in_parent_ = |
| 134 window->bounds().origin() + gfx::Vector2d(dx, dy); | 134 window->bounds().origin() + gfx::Vector2d(dx, dy); |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1616 EXPECT_TRUE(window_state->IsMaximized()); | 1616 EXPECT_TRUE(window_state->IsMaximized()); |
| 1617 } | 1617 } |
| 1618 | 1618 |
| 1619 // Tests run twice - on both panels and normal windows | 1619 // Tests run twice - on both panels and normal windows |
| 1620 INSTANTIATE_TEST_CASE_P(NormalOrPanel, | 1620 INSTANTIATE_TEST_CASE_P(NormalOrPanel, |
| 1621 DockedWindowResizerTest, | 1621 DockedWindowResizerTest, |
| 1622 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, | 1622 testing::Values(ui::wm::WINDOW_TYPE_NORMAL, |
| 1623 ui::wm::WINDOW_TYPE_PANEL)); | 1623 ui::wm::WINDOW_TYPE_PANEL)); |
| 1624 | 1624 |
| 1625 } // namespace ash | 1625 } // namespace ash |
| OLD | NEW |