| 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/common/shelf/shelf_layout_manager.h" | 5 #include "ash/common/shelf/shelf_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_shelf_aura.h" | 7 #include "ash/aura/wm_shelf_aura.h" |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/accelerators/accelerator_table.h" | 10 #include "ash/common/accelerators/accelerator_table.h" |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 } | 776 } |
| 777 | 777 |
| 778 // Test the behavior of the shelf when it is auto hidden and it is on the | 778 // Test the behavior of the shelf when it is auto hidden and it is on the |
| 779 // boundary between the primary and the secondary display. | 779 // boundary between the primary and the secondary display. |
| 780 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { | 780 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) { |
| 781 if (!SupportsMultipleDisplays()) | 781 if (!SupportsMultipleDisplays()) |
| 782 return; | 782 return; |
| 783 | 783 |
| 784 UpdateDisplay("800x600,800x600"); | 784 UpdateDisplay("800x600,800x600"); |
| 785 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | 785 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
| 786 test::CreateDisplayLayout(display::DisplayPlacement::RIGHT, 0)); | 786 test::CreateDisplayLayout(display_manager(), |
| 787 display::DisplayPlacement::RIGHT, 0)); |
| 787 // Put the primary monitor's shelf on the display boundary. | 788 // Put the primary monitor's shelf on the display boundary. |
| 788 WmShelf* shelf = GetPrimaryShelf(); | 789 WmShelf* shelf = GetPrimaryShelf(); |
| 789 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); | 790 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); |
| 790 | 791 |
| 791 // Create a window because the shelf is always shown when no windows are | 792 // Create a window because the shelf is always shown when no windows are |
| 792 // visible. | 793 // visible. |
| 793 CreateTestWidget(); | 794 CreateTestWidget(); |
| 794 | 795 |
| 795 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 796 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 796 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); | 797 EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); |
| (...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2039 // Open keyboard in sticky mode. | 2040 // Open keyboard in sticky mode. |
| 2040 kb_controller->ShowKeyboard(true); | 2041 kb_controller->ShowKeyboard(true); |
| 2041 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); | 2042 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); |
| 2042 | 2043 |
| 2043 // Work area should be changed. | 2044 // Work area should be changed. |
| 2044 EXPECT_NE(orig_work_area, | 2045 EXPECT_NE(orig_work_area, |
| 2045 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); | 2046 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); |
| 2046 } | 2047 } |
| 2047 | 2048 |
| 2048 } // namespace ash | 2049 } // namespace ash |
| OLD | NEW |