| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/accessibility_delegate.h" | 8 #include "ash/accessibility_delegate.h" |
| 9 #include "ash/accessibility_types.h" | 9 #include "ash/accessibility_types.h" |
| 10 #include "ash/drag_drop/drag_drop_controller.h" | 10 #include "ash/drag_drop/drag_drop_controller.h" |
| 11 #include "ash/public/cpp/config.h" | 11 #include "ash/public/cpp/config.h" |
| 12 #include "ash/shelf/wm_shelf.h" | 12 #include "ash/shelf/wm_shelf.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "ash/system/tray/system_tray.h" | 14 #include "ash/system/tray/system_tray.h" |
| 15 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
| 16 #include "ash/test/shelf_view_test_api.h" | 16 #include "ash/test/shelf_view_test_api.h" |
| 17 #include "ash/test/shell_test_api.h" | 17 #include "ash/test/shell_test_api.h" |
| 18 #include "ash/test/test_app_list_view_presenter_impl.h" | 18 #include "ash/test/test_app_list_view_presenter_impl.h" |
| 19 #include "ash/test/test_shelf_delegate.h" | |
| 20 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 19 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 21 #include "ash/wm/overview/window_grid.h" | 20 #include "ash/wm/overview/window_grid.h" |
| 22 #include "ash/wm/overview/window_selector.h" | 21 #include "ash/wm/overview/window_selector.h" |
| 23 #include "ash/wm/overview/window_selector_controller.h" | 22 #include "ash/wm/overview/window_selector_controller.h" |
| 24 #include "ash/wm/overview/window_selector_item.h" | 23 #include "ash/wm/overview/window_selector_item.h" |
| 25 #include "ash/wm/panels/panel_layout_manager.h" | 24 #include "ash/wm/panels/panel_layout_manager.h" |
| 26 #include "ash/wm/window_state.h" | 25 #include "ash/wm/window_state.h" |
| 27 #include "ash/wm/window_state_aura.h" | 26 #include "ash/wm/window_state_aura.h" |
| 28 #include "ash/wm/window_util.h" | 27 #include "ash/wm/window_util.h" |
| 29 #include "ash/wm/wm_event.h" | 28 #include "ash/wm/wm_event.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 window->aura_window()->SetProperty(aura::client::kTopViewInset, | 139 window->aura_window()->SetProperty(aura::client::kTopViewInset, |
| 141 kHeaderHeight); | 140 kHeaderHeight); |
| 142 ParentWindowInPrimaryRootWindow(widget->GetNativeWindow()); | 141 ParentWindowInPrimaryRootWindow(widget->GetNativeWindow()); |
| 143 return widget; | 142 return widget; |
| 144 } | 143 } |
| 145 | 144 |
| 146 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { | 145 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { |
| 147 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 146 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
| 148 nullptr, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); | 147 nullptr, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); |
| 149 window->SetProperty(aura::client::kTopViewInset, kHeaderHeight); | 148 window->SetProperty(aura::client::kTopViewInset, kHeaderHeight); |
| 150 test::TestShelfDelegate::instance()->AddShelfItem(WmWindow::Get(window)); | |
| 151 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); | 149 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); |
| 152 return window; | 150 return window; |
| 153 } | 151 } |
| 154 | 152 |
| 155 bool WindowsOverlapping(aura::Window* window1, aura::Window* window2) { | 153 bool WindowsOverlapping(aura::Window* window1, aura::Window* window2) { |
| 156 gfx::Rect window1_bounds = GetTransformedTargetBounds(window1); | 154 gfx::Rect window1_bounds = GetTransformedTargetBounds(window1); |
| 157 gfx::Rect window2_bounds = GetTransformedTargetBounds(window2); | 155 gfx::Rect window2_bounds = GetTransformedTargetBounds(window2); |
| 158 return window1_bounds.Intersects(window2_bounds); | 156 return window1_bounds.Intersects(window2_bounds); |
| 159 } | 157 } |
| 160 | 158 |
| (...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1854 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 1852 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
| 1855 ASSERT_TRUE(resizer.get()); | 1853 ASSERT_TRUE(resizer.get()); |
| 1856 gfx::Point location = resizer->GetInitialLocation(); | 1854 gfx::Point location = resizer->GetInitialLocation(); |
| 1857 location.Offset(20, 20); | 1855 location.Offset(20, 20); |
| 1858 resizer->Drag(location, 0); | 1856 resizer->Drag(location, 0); |
| 1859 ToggleOverview(); | 1857 ToggleOverview(); |
| 1860 resizer->RevertDrag(); | 1858 resizer->RevertDrag(); |
| 1861 } | 1859 } |
| 1862 | 1860 |
| 1863 } // namespace ash | 1861 } // namespace ash |
| OLD | NEW |