Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(837)

Side by Side Diff: ash/root_window_controller_unittest.cc

Issue 1608053002: Remove now-unnecessary wrappers around gfx::Screen::GetScreen() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-5
Patch Set: cros Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/screen_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/display/display_manager.h" 7 #include "ash/display/display_manager.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 keyboard_container->Show(); 823 keyboard_container->Show();
824 keyboard::KeyboardController* controller = 824 keyboard::KeyboardController* controller =
825 keyboard::KeyboardController::GetInstance(); 825 keyboard::KeyboardController::GetInstance();
826 aura::Window* keyboard_window = controller->ui()->GetKeyboardWindow(); 826 aura::Window* keyboard_window = controller->ui()->GetKeyboardWindow();
827 keyboard_container->AddChild(keyboard_window); 827 keyboard_container->AddChild(keyboard_window);
828 keyboard_window->set_owned_by_parent(false); 828 keyboard_window->set_owned_by_parent(false);
829 keyboard_window->SetBounds(keyboard::FullWidthKeyboardBoundsFromRootBounds( 829 keyboard_window->SetBounds(keyboard::FullWidthKeyboardBoundsFromRootBounds(
830 root_window->bounds(), 100)); 830 root_window->bounds(), 100));
831 keyboard_window->Show(); 831 keyboard_window->Show();
832 832
833 gfx::Rect before = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); 833 gfx::Rect before = gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area();
834 834
835 // Notify keyboard bounds changing. 835 // Notify keyboard bounds changing.
836 controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds()); 836 controller->NotifyKeyboardBoundsChanging(keyboard_container->bounds());
837 837
838 if (!keyboard::IsKeyboardOverscrollEnabled()) { 838 if (!keyboard::IsKeyboardOverscrollEnabled()) {
839 gfx::Rect after = ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(); 839 gfx::Rect after = gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area();
840 EXPECT_LT(after, before); 840 EXPECT_LT(after, before);
841 } 841 }
842 842
843 // Mock a login user profile change to reinitialize the keyboard. 843 // Mock a login user profile change to reinitialize the keyboard.
844 ash::Shell::GetInstance()->OnLoginUserProfilePrepared(); 844 ash::Shell::GetInstance()->OnLoginUserProfilePrepared();
845 EXPECT_EQ(ash::Shell::GetScreen()->GetPrimaryDisplay().work_area(), before); 845 EXPECT_EQ(gfx::Screen::GetScreen()->GetPrimaryDisplay().work_area(), before);
846 } 846 }
847 847
848 // Ensure that system modal dialogs do not block events targeted at the virtual 848 // Ensure that system modal dialogs do not block events targeted at the virtual
849 // keyboard. 849 // keyboard.
850 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) { 850 TEST_F(VirtualKeyboardRootWindowControllerTest, ClickWithActiveModalDialog) {
851 aura::Window* root_window = Shell::GetPrimaryRootWindow(); 851 aura::Window* root_window = Shell::GetPrimaryRootWindow();
852 aura::Window* keyboard_container = 852 aura::Window* keyboard_container =
853 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer); 853 Shell::GetContainer(root_window, kShellWindowId_VirtualKeyboardContainer);
854 ASSERT_TRUE(keyboard_container); 854 ASSERT_TRUE(keyboard_container);
855 keyboard_container->Show(); 855 keyboard_container->Show();
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds( 1029 keyboard_controller->ui()->GetKeyboardWindow()->SetBounds(
1030 gfx::Rect(0, 400, 800, 200)); 1030 gfx::Rect(0, 400, 800, 200));
1031 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString()); 1031 EXPECT_EQ("0,400 800x200", keyboard_container->bounds().ToString());
1032 1032
1033 UpdateDisplay("600x800"); 1033 UpdateDisplay("600x800");
1034 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString()); 1034 EXPECT_EQ("0,600 600x200", keyboard_container->bounds().ToString());
1035 } 1035 }
1036 1036
1037 } // namespace test 1037 } // namespace test
1038 } // namespace ash 1038 } // namespace ash
OLDNEW
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/screen_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698