| 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/workspace/workspace_layout_manager.h" | 5 #include "ash/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/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "ui/keyboard/keyboard_controller.h" | 33 #include "ui/keyboard/keyboard_controller.h" |
| 34 #include "ui/keyboard/keyboard_ui.h" | 34 #include "ui/keyboard/keyboard_ui.h" |
| 35 #include "ui/keyboard/keyboard_util.h" | 35 #include "ui/keyboard/keyboard_util.h" |
| 36 #include "ui/views/widget/widget.h" | 36 #include "ui/views/widget/widget.h" |
| 37 #include "ui/views/widget/widget_delegate.h" | 37 #include "ui/views/widget/widget_delegate.h" |
| 38 #include "ui/wm/core/window_util.h" | 38 #include "ui/wm/core/window_util.h" |
| 39 | 39 |
| 40 namespace ash { | 40 namespace ash { |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 WorkspaceLayoutManager* GetWorkspaceLayoutManager(WmWindow* container) { | 43 WorkspaceLayoutManager* GetWorkspaceLayoutManager(aura::Window* container) { |
| 44 return static_cast<WorkspaceLayoutManager*>(container->GetLayoutManager()); | 44 return static_cast<WorkspaceLayoutManager*>(container->layout_manager()); |
| 45 } | 45 } |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 class WorkspaceLayoutManagerKeyboardTest2 : public test::AshTestBase { | 49 class WorkspaceLayoutManagerKeyboardTest2 : public test::AshTestBase { |
| 50 public: | 50 public: |
| 51 WorkspaceLayoutManagerKeyboardTest2() : layout_manager_(nullptr) {} | 51 WorkspaceLayoutManagerKeyboardTest2() : layout_manager_(nullptr) {} |
| 52 ~WorkspaceLayoutManagerKeyboardTest2() override {} | 52 ~WorkspaceLayoutManagerKeyboardTest2() override {} |
| 53 | 53 |
| 54 void SetUp() override { | 54 void SetUp() override { |
| 55 test::AshTestBase::SetUp(); | 55 test::AshTestBase::SetUp(); |
| 56 UpdateDisplay("800x600"); | 56 UpdateDisplay("800x600"); |
| 57 WmWindow* default_container = | 57 aura::Window* default_container = |
| 58 ShellPort::Get()->GetPrimaryRootWindowController()->GetWmContainer( | 58 Shell::GetPrimaryRootWindowController()->GetContainer( |
| 59 kShellWindowId_DefaultContainer); | 59 kShellWindowId_DefaultContainer); |
| 60 layout_manager_ = GetWorkspaceLayoutManager(default_container); | 60 layout_manager_ = GetWorkspaceLayoutManager(default_container); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void ShowKeyboard() { | 63 void ShowKeyboard() { |
| 64 layout_manager_->OnKeyboardBoundsChanging(keyboard_bounds_); | 64 layout_manager_->OnKeyboardBoundsChanging(keyboard_bounds_); |
| 65 restore_work_area_insets_ = | 65 restore_work_area_insets_ = |
| 66 display::Screen::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets(); | 66 display::Screen::GetScreen()->GetPrimaryDisplay().GetWorkAreaInsets(); |
| 67 ShellPort::Get()->SetDisplayWorkAreaInsets( | 67 ShellPort::Get()->SetDisplayWorkAreaInsets( |
| 68 ShellPort::Get()->GetPrimaryRootWindow(), | 68 ShellPort::Get()->GetPrimaryRootWindow(), |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 changed_window_bounds.Offset(0, -shift); | 192 changed_window_bounds.Offset(0, -shift); |
| 193 // Window should be shifted up. | 193 // Window should be shifted up. |
| 194 EXPECT_EQ(changed_window_bounds, window->bounds()); | 194 EXPECT_EQ(changed_window_bounds, window->bounds()); |
| 195 | 195 |
| 196 kb_controller->HideKeyboard( | 196 kb_controller->HideKeyboard( |
| 197 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); | 197 keyboard::KeyboardController::HIDE_REASON_AUTOMATIC); |
| 198 EXPECT_EQ(orig_window_bounds, window->bounds()); | 198 EXPECT_EQ(orig_window_bounds, window->bounds()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace ash | 201 } // namespace ash |
| OLD | NEW |