| 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/display/display_manager.h" | 5 #include "ash/display/display_manager.h" |
| 6 #include "ash/root_window_controller.h" | 6 #include "ash/root_window_controller.h" |
| 7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Repro steps for http://crbug.com/401667: | 205 // Repro steps for http://crbug.com/401667: |
| 206 // 1. Set up login screen defaults: VK override disabled | 206 // 1. Set up login screen defaults: VK override disabled |
| 207 // 2. Show/hide keyboard, make sure that no stale keyboard bounds are cached. | 207 // 2. Show/hide keyboard, make sure that no stale keyboard bounds are cached. |
| 208 keyboard::SetKeyboardOverscrollOverride( | 208 keyboard::SetKeyboardOverscrollOverride( |
| 209 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED); | 209 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED); |
| 210 ShowKeyboard(true); | 210 ShowKeyboard(true); |
| 211 ShowKeyboard(false); | 211 ShowKeyboard(false); |
| 212 ash::DisplayManager* display_manager = | 212 ash::DisplayManager* display_manager = |
| 213 Shell::GetInstance()->display_manager(); | 213 Shell::GetInstance()->display_manager(); |
| 214 display_manager->SetDisplayRotation(primary_display.id(), | 214 display_manager->SetDisplayRotation(primary_display.id(), |
| 215 gfx::Display::ROTATE_90); | 215 gfx::Display::ROTATE_90, |
| 216 gfx::Display::ROTATION_SOURCE_ACTIVE); |
| 216 primary_display = Shell::GetScreen()->GetPrimaryDisplay(); | 217 primary_display = Shell::GetScreen()->GetPrimaryDisplay(); |
| 217 screen_bounds = primary_display.bounds(); | 218 screen_bounds = primary_display.bounds(); |
| 218 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 219 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
| 219 display_manager->SetDisplayRotation(primary_display.id(), | 220 display_manager->SetDisplayRotation(primary_display.id(), |
| 220 gfx::Display::ROTATE_0); | 221 gfx::Display::ROTATE_0, |
| 222 gfx::Display::ROTATION_SOURCE_ACTIVE); |
| 221 | 223 |
| 222 // When virtual keyboard overscroll is disabled keyboard bounds do | 224 // When virtual keyboard overscroll is disabled keyboard bounds do |
| 223 // affect window bounds. | 225 // affect window bounds. |
| 224 keyboard::SetKeyboardOverscrollOverride( | 226 keyboard::SetKeyboardOverscrollOverride( |
| 225 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED); | 227 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_DISABLED); |
| 226 ShowKeyboard(true); | 228 ShowKeyboard(true); |
| 227 keyboard::KeyboardController* keyboard = | 229 keyboard::KeyboardController* keyboard = |
| 228 keyboard::KeyboardController::GetInstance(); | 230 keyboard::KeyboardController::GetInstance(); |
| 229 primary_display = Shell::GetScreen()->GetPrimaryDisplay(); | 231 primary_display = Shell::GetScreen()->GetPrimaryDisplay(); |
| 230 screen_bounds = primary_display.bounds(); | 232 screen_bounds = primary_display.bounds(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window.get()); | 285 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window.get()); |
| 284 window->SetBounds(work_area); | 286 window->SetBounds(work_area); |
| 285 // Usually work_area takes Shelf into account but that doesn't affect | 287 // Usually work_area takes Shelf into account but that doesn't affect |
| 286 // LockScreen container windows. | 288 // LockScreen container windows. |
| 287 EXPECT_NE(work_area.ToString(), window->GetBoundsInScreen().ToString()); | 289 EXPECT_NE(work_area.ToString(), window->GetBoundsInScreen().ToString()); |
| 288 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 290 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
| 289 } | 291 } |
| 290 | 292 |
| 291 } // namespace test | 293 } // namespace test |
| 292 } // namespace ash | 294 } // namespace ash |
| OLD | NEW |