| 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" | |
| 8 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/accelerators/accelerator_controller.h" | 8 #include "ash/common/accelerators/accelerator_controller.h" |
| 10 #include "ash/common/accelerators/accelerator_table.h" | 9 #include "ash/common/accelerators/accelerator_table.h" |
| 11 #include "ash/common/focus_cycler.h" | 10 #include "ash/common/focus_cycler.h" |
| 12 #include "ash/common/material_design/material_design_controller.h" | 11 #include "ash/common/material_design/material_design_controller.h" |
| 13 #include "ash/common/session/session_state_delegate.h" | 12 #include "ash/common/session/session_state_delegate.h" |
| 14 #include "ash/common/shelf/shelf_constants.h" | 13 #include "ash/common/shelf/shelf_constants.h" |
| 15 #include "ash/common/shelf/shelf_layout_manager_observer.h" | 14 #include "ash/common/shelf/shelf_layout_manager_observer.h" |
| 16 #include "ash/common/shelf/shelf_view.h" | 15 #include "ash/common/shelf/shelf_view.h" |
| 17 #include "ash/common/shelf/shelf_widget.h" | 16 #include "ash/common/shelf/shelf_widget.h" |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 TEST_F(ShelfLayoutManagerTest, DualDisplayOpenAppListWithShelfAutoHideState) { | 1002 TEST_F(ShelfLayoutManagerTest, DualDisplayOpenAppListWithShelfAutoHideState) { |
| 1004 if (!SupportsMultipleDisplays()) | 1003 if (!SupportsMultipleDisplays()) |
| 1005 return; | 1004 return; |
| 1006 | 1005 |
| 1007 // Create two displays. | 1006 // Create two displays. |
| 1008 UpdateDisplay("0+0-200x200,+200+0-100x100"); | 1007 UpdateDisplay("0+0-200x200,+200+0-100x100"); |
| 1009 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 1008 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 1010 EXPECT_EQ(root_windows.size(), 2U); | 1009 EXPECT_EQ(root_windows.size(), 2U); |
| 1011 | 1010 |
| 1012 // Get the shelves in both displays and set them to be 'AutoHide'. | 1011 // Get the shelves in both displays and set them to be 'AutoHide'. |
| 1013 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf_aura(); | 1012 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf(); |
| 1014 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf_aura(); | 1013 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf(); |
| 1015 EXPECT_NE(shelf_1, shelf_2); | 1014 EXPECT_NE(shelf_1, shelf_2); |
| 1016 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), | 1015 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), |
| 1017 shelf_2->GetWindow()->GetRootWindow()); | 1016 shelf_2->GetWindow()->GetRootWindow()); |
| 1018 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1017 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1019 shelf_1->shelf_layout_manager()->LayoutShelf(); | 1018 shelf_1->shelf_layout_manager()->LayoutShelf(); |
| 1020 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1019 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1021 shelf_2->shelf_layout_manager()->LayoutShelf(); | 1020 shelf_2->shelf_layout_manager()->LayoutShelf(); |
| 1022 | 1021 |
| 1023 // Create a window in each display and show them in maximized state. | 1022 // Create a window in each display and show them in maximized state. |
| 1024 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); | 1023 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowDualDisplay) { | 1123 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowDualDisplay) { |
| 1125 if (!SupportsMultipleDisplays()) | 1124 if (!SupportsMultipleDisplays()) |
| 1126 return; | 1125 return; |
| 1127 | 1126 |
| 1128 // Create two displays. | 1127 // Create two displays. |
| 1129 UpdateDisplay("200x200,100x100"); | 1128 UpdateDisplay("200x200,100x100"); |
| 1130 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 1129 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 1131 EXPECT_EQ(2U, root_windows.size()); | 1130 EXPECT_EQ(2U, root_windows.size()); |
| 1132 | 1131 |
| 1133 // Get the shelves in both displays and set them to be 'AutoHide'. | 1132 // Get the shelves in both displays and set them to be 'AutoHide'. |
| 1134 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf_aura(); | 1133 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf(); |
| 1135 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf_aura(); | 1134 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf(); |
| 1136 EXPECT_NE(shelf_1, shelf_2); | 1135 EXPECT_NE(shelf_1, shelf_2); |
| 1137 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), | 1136 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), |
| 1138 shelf_2->GetWindow()->GetRootWindow()); | 1137 shelf_2->GetWindow()->GetRootWindow()); |
| 1139 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1138 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1140 shelf_1->shelf_layout_manager()->LayoutShelf(); | 1139 shelf_1->shelf_layout_manager()->LayoutShelf(); |
| 1141 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1140 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1142 shelf_2->shelf_layout_manager()->LayoutShelf(); | 1141 shelf_2->shelf_layout_manager()->LayoutShelf(); |
| 1143 | 1142 |
| 1144 // Create a window in each display and show them in maximized state. | 1143 // Create a window in each display and show them in maximized state. |
| 1145 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); | 1144 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 // Open keyboard in sticky mode. | 1821 // Open keyboard in sticky mode. |
| 1823 kb_controller->ShowKeyboard(true); | 1822 kb_controller->ShowKeyboard(true); |
| 1824 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); | 1823 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); |
| 1825 | 1824 |
| 1826 // Work area should be changed. | 1825 // Work area should be changed. |
| 1827 EXPECT_NE(orig_work_area, | 1826 EXPECT_NE(orig_work_area, |
| 1828 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); | 1827 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); |
| 1829 } | 1828 } |
| 1830 | 1829 |
| 1831 } // namespace ash | 1830 } // namespace ash |
| OLD | NEW |