| 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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/accessibility_delegate.h" | 10 #include "ash/accessibility_delegate.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ash/shell.h" | 21 #include "ash/shell.h" |
| 22 #include "ash/shell_observer.h" | 22 #include "ash/shell_observer.h" |
| 23 #include "ash/shell_port.h" | 23 #include "ash/shell_port.h" |
| 24 #include "ash/system/tray/system_tray_notifier.h" | 24 #include "ash/system/tray/system_tray_notifier.h" |
| 25 #include "ash/test/ash_test_base.h" | 25 #include "ash/test/ash_test_base.h" |
| 26 #include "ash/test/shell_test_api.h" | 26 #include "ash/test/shell_test_api.h" |
| 27 #include "ash/test/test_accessibility_delegate.h" | 27 #include "ash/test/test_accessibility_delegate.h" |
| 28 #include "ash/test/test_session_controller_client.h" | 28 #include "ash/test/test_session_controller_client.h" |
| 29 #include "ash/test/workspace_controller_test_api.h" | 29 #include "ash/test/workspace_controller_test_api.h" |
| 30 #include "ash/wm/fullscreen_window_finder.h" | 30 #include "ash/wm/fullscreen_window_finder.h" |
| 31 #include "ash/wm/maximize_mode/maximize_mode_backdrop_delegate_impl.h" | |
| 32 #include "ash/wm/overview/window_selector_controller.h" | 31 #include "ash/wm/overview/window_selector_controller.h" |
| 32 #include "ash/wm/tablet_mode/tablet_mode_backdrop_delegate_impl.h" |
| 33 #include "ash/wm/window_state.h" | 33 #include "ash/wm/window_state.h" |
| 34 #include "ash/wm/window_util.h" | 34 #include "ash/wm/window_util.h" |
| 35 #include "ash/wm/wm_event.h" | 35 #include "ash/wm/wm_event.h" |
| 36 #include "ash/wm/workspace/backdrop_delegate.h" | 36 #include "ash/wm/workspace/backdrop_delegate.h" |
| 37 #include "ash/wm/workspace/workspace_window_resizer.h" | 37 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 38 #include "ash/wm_window.h" | 38 #include "ash/wm_window.h" |
| 39 #include "base/command_line.h" | 39 #include "base/command_line.h" |
| 40 #include "base/run_loop.h" | 40 #include "base/run_loop.h" |
| 41 #include "chromeos/audio/chromeos_sounds.h" | 41 #include "chromeos/audio/chromeos_sounds.h" |
| 42 #include "ui/aura/client/aura_constants.h" | 42 #include "ui/aura/client/aura_constants.h" |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 AshTestBase::SetUp(); | 977 AshTestBase::SetUp(); |
| 978 UpdateDisplay("800x600"); | 978 UpdateDisplay("800x600"); |
| 979 default_container_ = Shell::GetPrimaryRootWindowController()->GetContainer( | 979 default_container_ = Shell::GetPrimaryRootWindowController()->GetContainer( |
| 980 kShellWindowId_DefaultContainer); | 980 kShellWindowId_DefaultContainer); |
| 981 } | 981 } |
| 982 | 982 |
| 983 // Turn the top window back drop on / off. | 983 // Turn the top window back drop on / off. |
| 984 void ShowTopWindowBackdrop(bool show) { | 984 void ShowTopWindowBackdrop(bool show) { |
| 985 std::unique_ptr<BackdropDelegate> backdrop; | 985 std::unique_ptr<BackdropDelegate> backdrop; |
| 986 if (show) { | 986 if (show) { |
| 987 backdrop = base::MakeUnique<MaximizeModeBackdropDelegateImpl>(); | 987 backdrop = base::MakeUnique<TabletModeBackdropDelegateImpl>(); |
| 988 } | 988 } |
| 989 GetWorkspaceLayoutManager(default_container_) | 989 GetWorkspaceLayoutManager(default_container_) |
| 990 ->SetBackdropDelegate(std::move(backdrop)); | 990 ->SetBackdropDelegate(std::move(backdrop)); |
| 991 // Closing and / or opening can be a delayed operation. | 991 // Closing and / or opening can be a delayed operation. |
| 992 base::RunLoop().RunUntilIdle(); | 992 base::RunLoop().RunUntilIdle(); |
| 993 } | 993 } |
| 994 | 994 |
| 995 // Return the default container. | 995 // Return the default container. |
| 996 aura::Window* default_container() { return default_container_; } | 996 aura::Window* default_container() { return default_container_; } |
| 997 | 997 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 backdrop = test_helper.GetBackdropWindow(); | 1234 backdrop = test_helper.GetBackdropWindow(); |
| 1235 EXPECT_TRUE(backdrop); | 1235 EXPECT_TRUE(backdrop); |
| 1236 { | 1236 { |
| 1237 aura::Window::Windows children = window1->parent()->children(); | 1237 aura::Window::Windows children = window1->parent()->children(); |
| 1238 EXPECT_EQ(children[0], backdrop); | 1238 EXPECT_EQ(children[0], backdrop); |
| 1239 EXPECT_EQ(children[1], window1.get()); | 1239 EXPECT_EQ(children[1], window1.get()); |
| 1240 EXPECT_EQ(children[2], window2.get()); | 1240 EXPECT_EQ(children[2], window2.get()); |
| 1241 EXPECT_EQ(children[3], window3.get()); | 1241 EXPECT_EQ(children[3], window3.get()); |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 // Enabling the backdrop delegate for maximized mode will put the | 1244 // Enabling the backdrop delegate for tablet mode will put the |
| 1245 // backdrop on the top most window. | 1245 // backdrop on the top most window. |
| 1246 ShowTopWindowBackdrop(true); | 1246 ShowTopWindowBackdrop(true); |
| 1247 { | 1247 { |
| 1248 aura::Window::Windows children = window1->parent()->children(); | 1248 aura::Window::Windows children = window1->parent()->children(); |
| 1249 EXPECT_EQ(children[0], window1.get()); | 1249 EXPECT_EQ(children[0], window1.get()); |
| 1250 EXPECT_EQ(children[1], window2.get()); | 1250 EXPECT_EQ(children[1], window2.get()); |
| 1251 EXPECT_EQ(children[2], backdrop); | 1251 EXPECT_EQ(children[2], backdrop); |
| 1252 EXPECT_EQ(children[3], window3.get()); | 1252 EXPECT_EQ(children[3], window3.get()); |
| 1253 } | 1253 } |
| 1254 | 1254 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1538 window->SetBounds(keyboard_bounds()); | 1538 window->SetBounds(keyboard_bounds()); |
| 1539 wm::GetWindowState(window.get())->set_ignore_keyboard_bounds_change(true); | 1539 wm::GetWindowState(window.get())->set_ignore_keyboard_bounds_change(true); |
| 1540 wm::ActivateWindow(window.get()); | 1540 wm::ActivateWindow(window.get()); |
| 1541 | 1541 |
| 1542 EXPECT_EQ(keyboard_bounds(), window->bounds()); | 1542 EXPECT_EQ(keyboard_bounds(), window->bounds()); |
| 1543 ShowKeyboard(); | 1543 ShowKeyboard(); |
| 1544 EXPECT_EQ(keyboard_bounds(), window->bounds()); | 1544 EXPECT_EQ(keyboard_bounds(), window->bounds()); |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 } // namespace ash | 1547 } // namespace ash |
| OLD | NEW |