| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/always_on_top_controller.h" | 5 #include "ash/common/wm/always_on_top_controller.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/common/wm/workspace/workspace_layout_manager.h" | 9 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
| 10 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h" | |
| 11 #include "ash/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| 12 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 13 #include "ash/test/ash_test_base.h" | 12 #include "ash/test/ash_test_base.h" |
| 14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 15 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 16 #include "ui/keyboard/keyboard_controller.h" | 15 #include "ui/keyboard/keyboard_controller.h" |
| 17 #include "ui/keyboard/keyboard_switches.h" | 16 #include "ui/keyboard/keyboard_switches.h" |
| 18 #include "ui/keyboard/keyboard_ui.h" | 17 #include "ui/keyboard/keyboard_ui.h" |
| 19 #include "ui/keyboard/keyboard_util.h" | 18 #include "ui/keyboard/keyboard_util.h" |
| 20 | 19 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 test::AshTestBase::SetUp(); | 31 test::AshTestBase::SetUp(); |
| 33 } | 32 } |
| 34 | 33 |
| 35 private: | 34 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardAlwaysOnTopControllerTest); | 35 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardAlwaysOnTopControllerTest); |
| 37 }; | 36 }; |
| 38 | 37 |
| 39 class TestLayoutManager : public WorkspaceLayoutManager { | 38 class TestLayoutManager : public WorkspaceLayoutManager { |
| 40 public: | 39 public: |
| 41 explicit TestLayoutManager(WmWindow* window) | 40 explicit TestLayoutManager(WmWindow* window) |
| 42 : WorkspaceLayoutManager(window, nullptr), | 41 : WorkspaceLayoutManager(window), keyboard_bounds_changed_(false) {} |
| 43 keyboard_bounds_changed_(false) {} | |
| 44 | 42 |
| 45 ~TestLayoutManager() override {} | 43 ~TestLayoutManager() override {} |
| 46 | 44 |
| 47 void OnKeyboardBoundsChanging(const gfx::Rect& bounds) override { | 45 void OnKeyboardBoundsChanging(const gfx::Rect& bounds) override { |
| 48 keyboard_bounds_changed_ = true; | 46 keyboard_bounds_changed_ = true; |
| 49 WorkspaceLayoutManager::OnKeyboardBoundsChanging(bounds); | 47 WorkspaceLayoutManager::OnKeyboardBoundsChanging(bounds); |
| 50 } | 48 } |
| 51 | 49 |
| 52 bool keyboard_bounds_changed() const { return keyboard_bounds_changed_; } | 50 bool keyboard_bounds_changed() const { return keyboard_bounds_changed_; } |
| 53 | 51 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 root_window->bounds(), kKeyboardHeight); | 86 root_window->bounds(), kKeyboardHeight); |
| 89 keyboard_window->SetBounds(keyboard_bounds); | 87 keyboard_window->SetBounds(keyboard_bounds); |
| 90 keyboard_window->Show(); | 88 keyboard_window->Show(); |
| 91 keyboard_controller->NotifyKeyboardBoundsChanging(keyboard_bounds); | 89 keyboard_controller->NotifyKeyboardBoundsChanging(keyboard_bounds); |
| 92 // Verify that test manager was notified of bounds change. | 90 // Verify that test manager was notified of bounds change. |
| 93 ASSERT_TRUE(manager->keyboard_bounds_changed()); | 91 ASSERT_TRUE(manager->keyboard_bounds_changed()); |
| 94 } | 92 } |
| 95 | 93 |
| 96 } // namespace test | 94 } // namespace test |
| 97 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |