| 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/display/display_layout.h" | |
| 11 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| 12 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
| 13 #include "ash/screen_util.h" | 12 #include "ash/screen_util.h" |
| 14 #include "ash/session/session_state_delegate.h" | 13 #include "ash/session/session_state_delegate.h" |
| 15 #include "ash/shelf/shelf.h" | 14 #include "ash/shelf/shelf.h" |
| 16 #include "ash/shelf/shelf_layout_manager.h" | 15 #include "ash/shelf/shelf_layout_manager.h" |
| 17 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 18 #include "ash/shell_observer.h" | 17 #include "ash/shell_observer.h" |
| 19 #include "ash/shell_window_ids.h" | 18 #include "ash/shell_window_ids.h" |
| 20 #include "ash/test/ash_test_base.h" | 19 #include "ash/test/ash_test_base.h" |
| 21 #include "ash/test/display_manager_test_api.h" | 20 #include "ash/test/display_manager_test_api.h" |
| 22 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" | 21 #include "ash/wm/maximize_mode/workspace_backdrop_delegate.h" |
| 23 #include "ash/wm/window_state.h" | 22 #include "ash/wm/window_state.h" |
| 24 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
| 25 #include "ash/wm/wm_event.h" | 24 #include "ash/wm/wm_event.h" |
| 26 #include "ash/wm/workspace/workspace_window_resizer.h" | 25 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 27 #include "base/compiler_specific.h" | 26 #include "base/compiler_specific.h" |
| 28 #include "ui/aura/client/aura_constants.h" | 27 #include "ui/aura/client/aura_constants.h" |
| 29 #include "ui/aura/test/test_windows.h" | 28 #include "ui/aura/test/test_windows.h" |
| 30 #include "ui/aura/window.h" | 29 #include "ui/aura/window.h" |
| 31 #include "ui/aura/window_event_dispatcher.h" | 30 #include "ui/aura/window_event_dispatcher.h" |
| 32 #include "ui/base/ui_base_types.h" | 31 #include "ui/base/ui_base_types.h" |
| 32 #include "ui/display/manager/display_layout.h" |
| 33 #include "ui/gfx/geometry/insets.h" | 33 #include "ui/gfx/geometry/insets.h" |
| 34 #include "ui/gfx/screen.h" | 34 #include "ui/gfx/screen.h" |
| 35 #include "ui/views/widget/widget.h" | 35 #include "ui/views/widget/widget.h" |
| 36 #include "ui/views/widget/widget_delegate.h" | 36 #include "ui/views/widget/widget_delegate.h" |
| 37 #include "ui/wm/core/window_util.h" | 37 #include "ui/wm/core/window_util.h" |
| 38 | 38 |
| 39 namespace ash { | 39 namespace ash { |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 class MaximizeDelegateView : public views::WidgetDelegateView { | 42 class MaximizeDelegateView : public views::WidgetDelegateView { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) { | 140 TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) { |
| 141 if (!SupportsMultipleDisplays()) | 141 if (!SupportsMultipleDisplays()) |
| 142 return; | 142 return; |
| 143 | 143 |
| 144 UpdateDisplay("300x400,400x500"); | 144 UpdateDisplay("300x400,400x500"); |
| 145 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 145 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 146 | 146 |
| 147 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( | 147 Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays( |
| 148 test::CreateDisplayLayout(DisplayPlacement::TOP, 0)); | 148 test::CreateDisplayLayout(display::DisplayPlacement::TOP, 0)); |
| 149 EXPECT_EQ("0,-500 400x500", root_windows[1]->GetBoundsInScreen().ToString()); | 149 EXPECT_EQ("0,-500 400x500", root_windows[1]->GetBoundsInScreen().ToString()); |
| 150 | 150 |
| 151 scoped_ptr<aura::Window> window1( | 151 scoped_ptr<aura::Window> window1( |
| 152 CreateTestWindowInShellWithBounds(gfx::Rect(10, -400, 200, 200))); | 152 CreateTestWindowInShellWithBounds(gfx::Rect(10, -400, 200, 200))); |
| 153 EXPECT_EQ("10,-400 200x200", window1->GetBoundsInScreen().ToString()); | 153 EXPECT_EQ("10,-400 200x200", window1->GetBoundsInScreen().ToString()); |
| 154 | 154 |
| 155 // Make sure the caption is visible. | 155 // Make sure the caption is visible. |
| 156 scoped_ptr<aura::Window> window2( | 156 scoped_ptr<aura::Window> window2( |
| 157 CreateTestWindowInShellWithBounds(gfx::Rect(10, -600, 200, 200))); | 157 CreateTestWindowInShellWithBounds(gfx::Rect(10, -600, 200, 200))); |
| 158 EXPECT_EQ("10,-500 200x200", window2->GetBoundsInScreen().ToString()); | 158 EXPECT_EQ("10,-500 200x200", window2->GetBoundsInScreen().ToString()); |
| (...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 EXPECT_EQ(gfx::Rect(50, | 1140 EXPECT_EQ(gfx::Rect(50, |
| 1141 keyboard_bounds.y() - keyboard_bounds.height()/2, | 1141 keyboard_bounds.y() - keyboard_bounds.height()/2, |
| 1142 occluded_window_bounds.width(), | 1142 occluded_window_bounds.width(), |
| 1143 occluded_window_bounds.height()).ToString(), | 1143 occluded_window_bounds.height()).ToString(), |
| 1144 window->bounds().ToString()); | 1144 window->bounds().ToString()); |
| 1145 HideKeyboard(); | 1145 HideKeyboard(); |
| 1146 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); | 1146 EXPECT_EQ(occluded_window_bounds.ToString(), window->bounds().ToString()); |
| 1147 } | 1147 } |
| 1148 | 1148 |
| 1149 } // namespace ash | 1149 } // namespace ash |
| OLD | NEW |