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/common/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
11 #include "ash/common/shelf/shelf_constants.h" | 11 #include "ash/common/shelf/shelf_constants.h" |
12 #include "ash/common/shelf/shelf_layout_manager.h" | 12 #include "ash/common/shelf/shelf_layout_manager.h" |
13 #include "ash/common/shelf/wm_shelf.h" | 13 #include "ash/common/shelf/wm_shelf.h" |
14 #include "ash/common/shell_observer.h" | 14 #include "ash/common/shell_observer.h" |
15 #include "ash/common/test/ash_test.h" | 15 #include "ash/common/test/ash_test.h" |
16 #include "ash/common/wm/fullscreen_window_finder.h" | 16 #include "ash/common/wm/fullscreen_window_finder.h" |
17 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" | 17 #include "ash/common/wm/maximize_mode/workspace_backdrop_delegate.h" |
18 #include "ash/common/wm/window_state.h" | 18 #include "ash/common/wm/window_state.h" |
19 #include "ash/common/wm/wm_event.h" | 19 #include "ash/common/wm/wm_event.h" |
20 #include "ash/common/wm/wm_screen_util.h" | 20 #include "ash/common/wm/wm_screen_util.h" |
21 #include "ash/common/wm/workspace/workspace_window_resizer.h" | 21 #include "ash/common/wm/workspace/workspace_window_resizer.h" |
22 #include "ash/common/wm_lookup.h" | 22 #include "ash/common/wm_lookup.h" |
23 #include "ash/common/wm_root_window_controller.h" | |
24 #include "ash/common/wm_shell.h" | 23 #include "ash/common/wm_shell.h" |
25 #include "ash/common/wm_window.h" | 24 #include "ash/common/wm_window.h" |
26 #include "ash/public/cpp/shell_window_ids.h" | 25 #include "ash/public/cpp/shell_window_ids.h" |
| 26 #include "ash/root_window_controller.h" |
27 #include "ash/shell.h" | 27 #include "ash/shell.h" |
28 #include "base/command_line.h" | 28 #include "base/command_line.h" |
29 #include "ui/base/ui_base_switches.h" | 29 #include "ui/base/ui_base_switches.h" |
30 #include "ui/base/ui_base_types.h" | 30 #include "ui/base/ui_base_types.h" |
31 #include "ui/display/display.h" | 31 #include "ui/display/display.h" |
32 #include "ui/display/screen.h" | 32 #include "ui/display/screen.h" |
33 #include "ui/gfx/geometry/insets.h" | 33 #include "ui/gfx/geometry/insets.h" |
34 #include "ui/keyboard/keyboard_controller.h" | 34 #include "ui/keyboard/keyboard_controller.h" |
35 #include "ui/keyboard/keyboard_ui.h" | 35 #include "ui/keyboard/keyboard_ui.h" |
36 #include "ui/keyboard/keyboard_util.h" | 36 #include "ui/keyboard/keyboard_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
51 // keyboard is refactored to work in mash. | 51 // keyboard is refactored to work in mash. |
52 class WorkspaceLayoutManagerKeyboardTest : public AshTest { | 52 class WorkspaceLayoutManagerKeyboardTest : public AshTest { |
53 public: | 53 public: |
54 WorkspaceLayoutManagerKeyboardTest() : layout_manager_(nullptr) {} | 54 WorkspaceLayoutManagerKeyboardTest() : layout_manager_(nullptr) {} |
55 ~WorkspaceLayoutManagerKeyboardTest() override {} | 55 ~WorkspaceLayoutManagerKeyboardTest() override {} |
56 | 56 |
57 void SetUp() override { | 57 void SetUp() override { |
58 AshTest::SetUp(); | 58 AshTest::SetUp(); |
59 UpdateDisplay("800x600"); | 59 UpdateDisplay("800x600"); |
60 WmWindow* default_container = | 60 WmWindow* default_container = |
61 WmShell::Get()->GetPrimaryRootWindowController()->GetContainer( | 61 WmShell::Get()->GetPrimaryRootWindowController()->GetWmContainer( |
62 kShellWindowId_DefaultContainer); | 62 kShellWindowId_DefaultContainer); |
63 layout_manager_ = GetWorkspaceLayoutManager(default_container); | 63 layout_manager_ = GetWorkspaceLayoutManager(default_container); |
64 } | 64 } |
65 | 65 |
66 void ShowKeyboard() { | 66 void ShowKeyboard() { |
67 layout_manager_->OnKeyboardBoundsChanging(keyboard_bounds_); | 67 layout_manager_->OnKeyboardBoundsChanging(keyboard_bounds_); |
68 restore_work_area_insets_ = | 68 restore_work_area_insets_ = |
69 display::Screen::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets(); | 69 display::Screen::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets(); |
70 WmShell::Get()->SetDisplayWorkAreaInsets( | 70 WmShell::Get()->SetDisplayWorkAreaInsets( |
71 WmShell::Get()->GetPrimaryRootWindow(), | 71 WmShell::Get()->GetPrimaryRootWindow(), |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 changed_window_bounds.Offset(0, -shift); | 197 changed_window_bounds.Offset(0, -shift); |
198 // Window should be shifted up. | 198 // Window should be shifted up. |
199 EXPECT_EQ(changed_window_bounds, window->GetBounds()); | 199 EXPECT_EQ(changed_window_bounds, window->GetBounds()); |
200 | 200 |
201 kb_controller->HideKeyboard( | 201 kb_controller->HideKeyboard( |
202 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); | 202 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); |
203 EXPECT_EQ(orig_window_bounds, window->GetBounds()); | 203 EXPECT_EQ(orig_window_bounds, window->GetBounds()); |
204 } | 204 } |
205 | 205 |
206 } // namespace ash | 206 } // namespace ash |
OLD | NEW |