| 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/public/cpp/window_properties.h" |
| 12 #include "ash/shelf/wm_shelf.h" | 13 #include "ash/shelf/wm_shelf.h" |
| 13 #include "ash/shell.h" | 14 #include "ash/shell.h" |
| 14 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
| 15 #include "ash/test/ash_test_base.h" | 16 #include "ash/test/ash_test_base.h" |
| 16 #include "ash/test/shelf_view_test_api.h" | 17 #include "ash/test/shelf_view_test_api.h" |
| 17 #include "ash/test/shell_test_api.h" | 18 #include "ash/test/shell_test_api.h" |
| 18 #include "ash/test/test_app_list_view_presenter_impl.h" | 19 #include "ash/test/test_app_list_view_presenter_impl.h" |
| 19 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 20 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 20 #include "ash/wm/overview/window_grid.h" | 21 #include "ash/wm/overview/window_grid.h" |
| 21 #include "ash/wm/overview/window_selector.h" | 22 #include "ash/wm/overview/window_selector.h" |
| 22 #include "ash/wm/overview/window_selector_controller.h" | 23 #include "ash/wm/overview/window_selector_controller.h" |
| 23 #include "ash/wm/overview/window_selector_item.h" | 24 #include "ash/wm/overview/window_selector_item.h" |
| 24 #include "ash/wm/panels/panel_layout_manager.h" | 25 #include "ash/wm/panels/panel_layout_manager.h" |
| 25 #include "ash/wm/window_state.h" | 26 #include "ash/wm/window_state.h" |
| 26 #include "ash/wm/window_state_aura.h" | 27 #include "ash/wm/window_state_aura.h" |
| 27 #include "ash/wm/window_util.h" | 28 #include "ash/wm/window_util.h" |
| 28 #include "ash/wm/wm_event.h" | 29 #include "ash/wm/wm_event.h" |
| 29 #include "ash/wm/workspace/workspace_window_resizer.h" | 30 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 30 #include "ash/wm_window.h" | 31 #include "ash/wm_window.h" |
| 32 #include "base/strings/string_number_conversions.h" |
| 31 #include "base/strings/utf_string_conversions.h" | 33 #include "base/strings/utf_string_conversions.h" |
| 32 #include "base/test/user_action_tester.h" | 34 #include "base/test/user_action_tester.h" |
| 33 #include "ui/aura/client/aura_constants.h" | 35 #include "ui/aura/client/aura_constants.h" |
| 34 #include "ui/aura/client/focus_client.h" | 36 #include "ui/aura/client/focus_client.h" |
| 35 #include "ui/aura/test/test_windows.h" | 37 #include "ui/aura/test/test_windows.h" |
| 36 #include "ui/aura/window.h" | 38 #include "ui/aura/window.h" |
| 37 #include "ui/base/hit_test.h" | 39 #include "ui/base/hit_test.h" |
| 38 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 40 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 39 #include "ui/display/display_layout.h" | 41 #include "ui/display/display_layout.h" |
| 40 #include "ui/display/manager/display_manager.h" | 42 #include "ui/display/manager/display_manager.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 WmWindow* window = WmWindow::Get(widget->GetNativeWindow()); | 140 WmWindow* window = WmWindow::Get(widget->GetNativeWindow()); |
| 139 window->aura_window()->SetProperty(aura::client::kTopViewInset, | 141 window->aura_window()->SetProperty(aura::client::kTopViewInset, |
| 140 kHeaderHeight); | 142 kHeaderHeight); |
| 141 ParentWindowInPrimaryRootWindow(widget->GetNativeWindow()); | 143 ParentWindowInPrimaryRootWindow(widget->GetNativeWindow()); |
| 142 return widget; | 144 return widget; |
| 143 } | 145 } |
| 144 | 146 |
| 145 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { | 147 aura::Window* CreatePanelWindow(const gfx::Rect& bounds) { |
| 146 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( | 148 aura::Window* window = CreateTestWindowInShellWithDelegateAndType( |
| 147 nullptr, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); | 149 nullptr, ui::wm::WINDOW_TYPE_PANEL, 0, bounds); |
| 150 static int id = 0; |
| 151 window->SetProperty(kShelfIDKey, new ShelfID(base::IntToString(id++))); |
| 148 window->SetProperty(aura::client::kTopViewInset, kHeaderHeight); | 152 window->SetProperty(aura::client::kTopViewInset, kHeaderHeight); |
| 149 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); | 153 shelf_view_test()->RunMessageLoopUntilAnimationsDone(); |
| 150 return window; | 154 return window; |
| 151 } | 155 } |
| 152 | 156 |
| 153 bool WindowsOverlapping(aura::Window* window1, aura::Window* window2) { | 157 bool WindowsOverlapping(aura::Window* window1, aura::Window* window2) { |
| 154 gfx::Rect window1_bounds = GetTransformedTargetBounds(window1); | 158 gfx::Rect window1_bounds = GetTransformedTargetBounds(window1); |
| 155 gfx::Rect window2_bounds = GetTransformedTargetBounds(window2); | 159 gfx::Rect window2_bounds = GetTransformedTargetBounds(window2); |
| 156 return window1_bounds.Intersects(window2_bounds); | 160 return window1_bounds.Intersects(window2_bounds); |
| 157 } | 161 } |
| (...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1852 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 1856 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
| 1853 ASSERT_TRUE(resizer.get()); | 1857 ASSERT_TRUE(resizer.get()); |
| 1854 gfx::Point location = resizer->GetInitialLocation(); | 1858 gfx::Point location = resizer->GetInitialLocation(); |
| 1855 location.Offset(20, 20); | 1859 location.Offset(20, 20); |
| 1856 resizer->Drag(location, 0); | 1860 resizer->Drag(location, 0); |
| 1857 ToggleOverview(); | 1861 ToggleOverview(); |
| 1858 resizer->RevertDrag(); | 1862 resizer->RevertDrag(); |
| 1859 } | 1863 } |
| 1860 | 1864 |
| 1861 } // namespace ash | 1865 } // namespace ash |
| OLD | NEW |