| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 keyboard_container->Show(); | 813 keyboard_container->Show(); |
| 814 keyboard::KeyboardController* controller = | 814 keyboard::KeyboardController* controller = |
| 815 keyboard::KeyboardController::GetInstance(); | 815 keyboard::KeyboardController::GetInstance(); |
| 816 aura::Window* keyboard_window = controller->ui()->GetKeyboardWindow(); | 816 aura::Window* keyboard_window = controller->ui()->GetKeyboardWindow(); |
| 817 keyboard_container->AddChild(keyboard_window); | 817 keyboard_container->AddChild(keyboard_window); |
| 818 keyboard_window->set_owned_by_parent(false); | 818 keyboard_window->set_owned_by_parent(false); |
| 819 keyboard_window->SetBounds(keyboard::FullWidthKeyboardBoundsFromRootBounds( | 819 keyboard_window->SetBounds(keyboard::FullWidthKeyboardBoundsFromRootBounds( |
| 820 root_window->bounds(), 100)); | 820 root_window->bounds(), 100)); |
| 821 keyboard_window->Show(); | 821 keyboard_window->Show(); |
| 822 | 822 |
| 823 gfx::Rect before = gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area(); | 823 gfx::Rect before = |
| 824 display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); |
| 824 | 825 |
| 825 // Notify keyboard bounds changing. | 826 // Notify keyboard bounds changing. |
| 826 controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds()); | 827 controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds()); |
| 827 | 828 |
| 828 if (!keyboard::IsKeyboardOverscrollEnabled()) { | 829 if (!keyboard::IsKeyboardOverscrollEnabled()) { |
| 829 gfx::Rect after = gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area(); | 830 gfx::Rect after = |
| 831 display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); |
| 830 EXPECT_LT(after, before); | 832 EXPECT_LT(after, before); |
| 831 } | 833 } |
| 832 | 834 |
| 833 // Mock a login user profile change to reinitialize the keyboard. | 835 // Mock a login user profile change to reinitialize the keyboard. |
| 834 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); | 836 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); |
| 835 EXPECT_EQ(gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area(), before); | 837 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().work_area(), |
| 838 before); |
| 836 } | 839 } |
| 837 | 840 |
| 838 // Ensure that system modal dialogs do not block events targeted at the virtual | 841 // Ensure that system modal dialogs do not block events targeted at the virtual |
| 839 // keyboard. | 842 // keyboard. |
| 840 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { | 843 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { |
| 841 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 844 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
| 842 aura::Window* keyboard_container = | 845 aura::Window* keyboard_container = |
| 843 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); | 846 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); |
| 844 ASSERT_TRUE(keyboard_container); | 847 ASSERT_TRUE(keyboard_container); |
| 845 keyboard_container->Show(); | 848 keyboard_container->Show(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( | 1019 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( |
| 1017 gfx::Rect(0, 400, 800, 200)); | 1020 gfx::Rect(0, 400, 800, 200)); |
| 1018 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); | 1021 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); |
| 1019 | 1022 |
| 1020 UpdateDisplay("600x800"); | 1023 UpdateDisplay("600x800"); |
| 1021 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); | 1024 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); |
| 1022 } | 1025 } |
| 1023 | 1026 |
| 1024 } // namespace test | 1027 } // namespace test |
| 1025 } // namespace ash | 1028 } // namespace ash |
| OLD | NEW |