| 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/wm/workspace/workspace_layout_manager.h" | 5 #include "ash/common/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/common/wm/fullscreen_window_finder.h" | 10 #include "ash/common/wm/fullscreen_window_finder.h" |
| (...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 Shelf::ForWindow(window.get())->shelf_layout_manager(); | 740 Shelf::ForWindow(window.get())->shelf_layout_manager(); |
| 741 shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); | 741 shelf_layout_manager->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS); |
| 742 | 742 |
| 743 window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get())); | 743 window->SetBounds(ScreenUtil::GetMaximizedWindowBoundsInParent(window.get())); |
| 744 gfx::Rect window_bounds = window->bounds(); | 744 gfx::Rect window_bounds = window->bounds(); |
| 745 EXPECT_EQ( | 745 EXPECT_EQ( |
| 746 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), | 746 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), |
| 747 window_bounds.ToString()); | 747 window_bounds.ToString()); |
| 748 | 748 |
| 749 // The window size should not get touched while we are in lock screen. | 749 // The window size should not get touched while we are in lock screen. |
| 750 Shell::GetInstance()->session_state_delegate()->LockScreen(); | 750 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); |
| 751 shelf_layout_manager->UpdateVisibilityState(); | 751 shelf_layout_manager->UpdateVisibilityState(); |
| 752 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); | 752 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); |
| 753 | 753 |
| 754 // Coming out of the lock screen the window size should still remain. | 754 // Coming out of the lock screen the window size should still remain. |
| 755 Shell::GetInstance()->session_state_delegate()->UnlockScreen(); | 755 WmShell::Get()->GetSessionStateDelegate()->UnlockScreen(); |
| 756 shelf_layout_manager->UpdateVisibilityState(); | 756 shelf_layout_manager->UpdateVisibilityState(); |
| 757 EXPECT_EQ( | 757 EXPECT_EQ( |
| 758 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), | 758 ScreenUtil::GetMaximizedWindowBoundsInParent(window.get()).ToString(), |
| 759 window_bounds.ToString()); | 759 window_bounds.ToString()); |
| 760 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); | 760 EXPECT_EQ(window_bounds.ToString(), window->bounds().ToString()); |
| 761 } | 761 } |
| 762 | 762 |
| 763 // TODO(sky): these are commented out until maximize mode ported. | 763 // TODO(sky): these are commented out until maximize mode ported. |
| 764 // http://crbug.com/612629. | 764 // http://crbug.com/612629. |
| 765 | 765 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 784 kShellWindowId_DefaultContainer); | 784 kShellWindowId_DefaultContainer); |
| 785 } | 785 } |
| 786 | 786 |
| 787 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { | 787 aura::Window* CreateTestWindow(const gfx::Rect& bounds) { |
| 788 aura::Window* window = CreateTestWindowInShellWithBounds(bounds); | 788 aura::Window* window = CreateTestWindowInShellWithBounds(bounds); |
| 789 return window; | 789 return window; |
| 790 } | 790 } |
| 791 | 791 |
| 792 // Turn the top window back drop on / off. | 792 // Turn the top window back drop on / off. |
| 793 void ShowTopWindowBackdrop(bool show) { | 793 void ShowTopWindowBackdrop(bool show) { |
| 794 std::unique_ptr<ash::WorkspaceLayoutManagerBackdropDelegate> backdrop; | 794 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> backdrop; |
| 795 if (show) { | 795 if (show) |
| 796 backdrop.reset(new ash::WorkspaceBackdropDelegate(default_container_)); | 796 backdrop.reset(new WorkspaceBackdropDelegate(default_container_)); |
| 797 } | |
| 798 GetWorkspaceLayoutManager(default_container_) | 797 GetWorkspaceLayoutManager(default_container_) |
| 799 ->SetMaximizeBackdropDelegate(std::move(backdrop)); | 798 ->SetMaximizeBackdropDelegate(std::move(backdrop)); |
| 800 // Closing and / or opening can be a delayed operation. | 799 // Closing and / or opening can be a delayed operation. |
| 801 base::RunLoop().RunUntilIdle(); | 800 base::RunLoop().RunUntilIdle(); |
| 802 } | 801 } |
| 803 | 802 |
| 804 // Return the default container. | 803 // Return the default container. |
| 805 aura::Window* default_container() { return default_container_; } | 804 aura::Window* default_container() { return default_container_; } |
| 806 | 805 |
| 807 // Return the order of windows (top most first) as they are in the default | 806 // Return the order of windows (top most first) as they are in the default |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 occluded_window_bounds.width(), | 1095 occluded_window_bounds.width(), |
| 1097 occluded_window_bounds.height()).ToString(), | 1096 occluded_window_bounds.height()).ToString(), |
| 1098 window->bounds().ToString()); | 1097 window->bounds().ToString()); |
| 1099 HideKeyboard(); | 1098 HideKeyboard(); |
| 1100 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); | 1099 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); |
| 1101 } | 1100 } |
| 1102 */ | 1101 */ |
| 1103 | 1102 |
| 1104 } // namespace mus | 1103 } // namespace mus |
| 1105 } // namespace ash | 1104 } // namespace ash |
| OLD | NEW |