| 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 18 matching lines...) Expand all Loading... |
| 29 const int kVirtualKeyboardHeight = 100; | 29 const int kVirtualKeyboardHeight = 100; |
| 30 | 30 |
| 31 // A login implementation of WidgetDelegate. | 31 // A login implementation of WidgetDelegate. |
| 32 class LoginTestWidgetDelegate : public views::WidgetDelegate { | 32 class LoginTestWidgetDelegate : public views::WidgetDelegate { |
| 33 public: | 33 public: |
| 34 explicit LoginTestWidgetDelegate(views::Widget* widget) : widget_(widget) { | 34 explicit LoginTestWidgetDelegate(views::Widget* widget) : widget_(widget) { |
| 35 } | 35 } |
| 36 virtual ~LoginTestWidgetDelegate() {} | 36 virtual ~LoginTestWidgetDelegate() {} |
| 37 | 37 |
| 38 // Overridden from WidgetDelegate: | 38 // Overridden from WidgetDelegate: |
| 39 virtual void DeleteDelegate() OVERRIDE { | 39 virtual void DeleteDelegate() override { |
| 40 delete this; | 40 delete this; |
| 41 } | 41 } |
| 42 virtual views::Widget* GetWidget() OVERRIDE { | 42 virtual views::Widget* GetWidget() override { |
| 43 return widget_; | 43 return widget_; |
| 44 } | 44 } |
| 45 virtual const views::Widget* GetWidget() const OVERRIDE { | 45 virtual const views::Widget* GetWidget() const override { |
| 46 return widget_; | 46 return widget_; |
| 47 } | 47 } |
| 48 virtual bool CanActivate() const OVERRIDE { | 48 virtual bool CanActivate() const override { |
| 49 return true; | 49 return true; |
| 50 } | 50 } |
| 51 virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE { | 51 virtual bool ShouldAdvanceFocusToTopLevelWidget() const override { |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 views::Widget* widget_; | 56 views::Widget* widget_; |
| 57 | 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(LoginTestWidgetDelegate); | 58 DISALLOW_COPY_AND_ASSIGN(LoginTestWidgetDelegate); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace | 61 } // namespace |
| 62 | 62 |
| 63 class LockLayoutManagerTest : public AshTestBase { | 63 class LockLayoutManagerTest : public AshTestBase { |
| 64 public: | 64 public: |
| 65 virtual void SetUp() OVERRIDE { | 65 virtual void SetUp() override { |
| 66 // Allow a virtual keyboard (and initialize it per default). | 66 // Allow a virtual keyboard (and initialize it per default). |
| 67 CommandLine::ForCurrentProcess()->AppendSwitch( | 67 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 68 keyboard::switches::kEnableVirtualKeyboard); | 68 keyboard::switches::kEnableVirtualKeyboard); |
| 69 AshTestBase::SetUp(); | 69 AshTestBase::SetUp(); |
| 70 Shell::GetPrimaryRootWindowController()->ActivateKeyboard( | 70 Shell::GetPrimaryRootWindowController()->ActivateKeyboard( |
| 71 keyboard::KeyboardController::GetInstance()); | 71 keyboard::KeyboardController::GetInstance()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 virtual void TearDown() OVERRIDE { | 74 virtual void TearDown() override { |
| 75 Shell::GetPrimaryRootWindowController()->DeactivateKeyboard( | 75 Shell::GetPrimaryRootWindowController()->DeactivateKeyboard( |
| 76 keyboard::KeyboardController::GetInstance()); | 76 keyboard::KeyboardController::GetInstance()); |
| 77 AshTestBase::TearDown(); | 77 AshTestBase::TearDown(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 aura::Window* CreateTestLoginWindow(views::Widget::InitParams params, | 80 aura::Window* CreateTestLoginWindow(views::Widget::InitParams params, |
| 81 bool use_delegate) { | 81 bool use_delegate) { |
| 82 aura::Window* parent = Shell::GetPrimaryRootWindowController()-> | 82 aura::Window* parent = Shell::GetPrimaryRootWindowController()-> |
| 83 GetContainer(ash::kShellWindowId_LockScreenContainer); | 83 GetContainer(ash::kShellWindowId_LockScreenContainer); |
| 84 params.parent = parent; | 84 params.parent = parent; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window.get()); | 293 ScreenUtil::GetDisplayWorkAreaBoundsInParent(window.get()); |
| 294 window->SetBounds(work_area); | 294 window->SetBounds(work_area); |
| 295 // Usually work_area takes Shelf into account but that doesn't affect | 295 // Usually work_area takes Shelf into account but that doesn't affect |
| 296 // LockScreen container windows. | 296 // LockScreen container windows. |
| 297 EXPECT_NE(work_area.ToString(), window->GetBoundsInScreen().ToString()); | 297 EXPECT_NE(work_area.ToString(), window->GetBoundsInScreen().ToString()); |
| 298 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); | 298 EXPECT_EQ(screen_bounds.ToString(), window->GetBoundsInScreen().ToString()); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace test | 301 } // namespace test |
| 302 } // namespace ash | 302 } // namespace ash |
| OLD | NEW |