| 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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 TEST_F(ShelfLayoutManagerTest, DualDisplayOpenAppListWithShelfAutoHideState) { | 1012 TEST_F(ShelfLayoutManagerTest, DualDisplayOpenAppListWithShelfAutoHideState) { |
| 1014 if (!SupportsMultipleDisplays()) | 1013 if (!SupportsMultipleDisplays()) |
| 1015 return; | 1014 return; |
| 1016 | 1015 |
| 1017 // Create two displays. | 1016 // Create two displays. |
| 1018 UpdateDisplay("0+0-200x200,+200+0-100x100"); | 1017 UpdateDisplay("0+0-200x200,+200+0-100x100"); |
| 1019 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 1018 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 1020 EXPECT_EQ(root_windows.size(), 2U); | 1019 EXPECT_EQ(root_windows.size(), 2U); |
| 1021 | 1020 |
| 1022 // Get the shelves in both displays and set them to be 'AutoHide'. | 1021 // Get the shelves in both displays and set them to be 'AutoHide'. |
| 1023 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf_aura(); | 1022 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf(); |
| 1024 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf_aura(); | 1023 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf(); |
| 1025 EXPECT_NE(shelf_1, shelf_2); | 1024 EXPECT_NE(shelf_1, shelf_2); |
| 1026 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), | 1025 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), |
| 1027 shelf_2->GetWindow()->GetRootWindow()); | 1026 shelf_2->GetWindow()->GetRootWindow()); |
| 1028 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1027 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1029 shelf_1->shelf_layout_manager()->LayoutShelf(); | 1028 shelf_1->shelf_layout_manager()->LayoutShelf(); |
| 1030 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1029 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1031 shelf_2->shelf_layout_manager()->LayoutShelf(); | 1030 shelf_2->shelf_layout_manager()->LayoutShelf(); |
| 1032 | 1031 |
| 1033 // Create a window in each display and show them in maximized state. | 1032 // Create a window in each display and show them in maximized state. |
| 1034 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); | 1033 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowDualDisplay) { | 1133 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowDualDisplay) { |
| 1135 if (!SupportsMultipleDisplays()) | 1134 if (!SupportsMultipleDisplays()) |
| 1136 return; | 1135 return; |
| 1137 | 1136 |
| 1138 // Create two displays. | 1137 // Create two displays. |
| 1139 UpdateDisplay("200x200,100x100"); | 1138 UpdateDisplay("200x200,100x100"); |
| 1140 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 1139 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 1141 EXPECT_EQ(2U, root_windows.size()); | 1140 EXPECT_EQ(2U, root_windows.size()); |
| 1142 | 1141 |
| 1143 // Get the shelves in both displays and set them to be 'AutoHide'. | 1142 // Get the shelves in both displays and set them to be 'AutoHide'. |
| 1144 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf_aura(); | 1143 WmShelf* shelf_1 = GetRootWindowController(root_windows[0])->wm_shelf(); |
| 1145 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf_aura(); | 1144 WmShelf* shelf_2 = GetRootWindowController(root_windows[1])->wm_shelf(); |
| 1146 EXPECT_NE(shelf_1, shelf_2); | 1145 EXPECT_NE(shelf_1, shelf_2); |
| 1147 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), | 1146 EXPECT_NE(shelf_1->GetWindow()->GetRootWindow(), |
| 1148 shelf_2->GetWindow()->GetRootWindow()); | 1147 shelf_2->GetWindow()->GetRootWindow()); |
| 1149 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1148 shelf_1->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1150 shelf_1->shelf_layout_manager()->LayoutShelf(); | 1149 shelf_1->shelf_layout_manager()->LayoutShelf(); |
| 1151 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 1150 shelf_2->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 1152 shelf_2->shelf_layout_manager()->LayoutShelf(); | 1151 shelf_2->shelf_layout_manager()->LayoutShelf(); |
| 1153 | 1152 |
| 1154 // Create a window in each display and show them in maximized state. | 1153 // Create a window in each display and show them in maximized state. |
| 1155 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); | 1154 aura::Window* window_1 = CreateTestWindowInParent(root_windows[0]); |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1849 // Open keyboard in sticky mode. | 1848 // Open keyboard in sticky mode. |
| 1850 kb_controller->ShowKeyboard(true); | 1849 kb_controller->ShowKeyboard(true); |
| 1851 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); | 1850 layout_manager->OnKeyboardBoundsChanging(keyboard_bounds()); |
| 1852 | 1851 |
| 1853 // Work area should be changed. | 1852 // Work area should be changed. |
| 1854 EXPECT_NE(orig_work_area, | 1853 EXPECT_NE(orig_work_area, |
| 1855 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); | 1854 display::Screen::GetScreen()->GetPrimaryDisplay().work_area()); |
| 1856 } | 1855 } |
| 1857 | 1856 |
| 1858 } // namespace ash | 1857 } // namespace ash |
| OLD | NEW |