| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/maximize_mode/maximize_mode_window_manager.h" | 5 #include "ash/wm/maximize_mode/maximize_mode_window_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| 11 #include "ash/shelf/shelf_layout_manager.h" | 11 #include "ash/shelf/shelf_layout_manager.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/switchable_windows.h" | |
| 14 #include "ash/test/ash_test_base.h" | 13 #include "ash/test/ash_test_base.h" |
| 15 #include "ash/test/shell_test_api.h" | 14 #include "ash/test/shell_test_api.h" |
| 15 #include "ash/wm/common/switchable_windows.h" |
| 16 #include "ash/wm/common/window_state.h" | 16 #include "ash/wm/common/window_state.h" |
| 17 #include "ash/wm/common/wm_event.h" | 17 #include "ash/wm/common/wm_event.h" |
| 18 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 18 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 19 #include "ash/wm/mru_window_tracker.h" | 19 #include "ash/wm/mru_window_tracker.h" |
| 20 #include "ash/wm/overview/window_selector_controller.h" | 20 #include "ash/wm/overview/window_selector_controller.h" |
| 21 #include "ash/wm/window_properties.h" | 21 #include "ash/wm/window_properties.h" |
| 22 #include "ash/wm/window_state_aura.h" | 22 #include "ash/wm/window_state_aura.h" |
| 23 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
| 24 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 delegate->set_window_component(HTCAPTION); | 127 delegate->set_window_component(HTCAPTION); |
| 128 if (!max_size.IsEmpty()) | 128 if (!max_size.IsEmpty()) |
| 129 delegate->set_maximum_size(max_size); | 129 delegate->set_maximum_size(max_size); |
| 130 } | 130 } |
| 131 aura::Window* window = aura::test::CreateTestWindowWithDelegateAndType( | 131 aura::Window* window = aura::test::CreateTestWindowWithDelegateAndType( |
| 132 delegate, type, 0, bounds, NULL); | 132 delegate, type, 0, bounds, NULL); |
| 133 window->SetProperty(aura::client::kCanMaximizeKey, can_maximize); | 133 window->SetProperty(aura::client::kCanMaximizeKey, can_maximize); |
| 134 if (!can_resize) | 134 if (!can_resize) |
| 135 window->SetProperty(aura::client::kCanResizeKey, false); | 135 window->SetProperty(aura::client::kCanResizeKey, false); |
| 136 aura::Window* container = Shell::GetContainer( | 136 aura::Window* container = Shell::GetContainer( |
| 137 Shell::GetPrimaryRootWindow(), | 137 Shell::GetPrimaryRootWindow(), wm::kSwitchableWindowContainerIds[0]); |
| 138 kSwitchableWindowContainerIds[0]); | |
| 139 container->AddChild(window); | 138 container->AddChild(window); |
| 140 return window; | 139 return window; |
| 141 } | 140 } |
| 142 | 141 |
| 143 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManagerTest); | 142 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManagerTest); |
| 144 }; | 143 }; |
| 145 | 144 |
| 146 // Test that creating the object and destroying it without any windows should | 145 // Test that creating the object and destroying it without any windows should |
| 147 // not cause any problems. | 146 // not cause any problems. |
| 148 TEST_F(MaximizeModeWindowManagerTest, SimpleStart) { | 147 TEST_F(MaximizeModeWindowManagerTest, SimpleStart) { |
| (...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 | 1446 |
| 1448 ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); | 1447 ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
| 1449 EXPECT_TRUE(wm::GetWindowState(window.get())->IsDocked()); | 1448 EXPECT_TRUE(wm::GetWindowState(window.get())->IsDocked()); |
| 1450 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 1449 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
| 1451 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); | 1450 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
| 1452 } | 1451 } |
| 1453 | 1452 |
| 1454 #endif // OS_WIN | 1453 #endif // OS_WIN |
| 1455 | 1454 |
| 1456 } // namespace ash | 1455 } // namespace ash |
| OLD | NEW |