| 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" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // Get the maximze window manager. | 98 // Get the maximze window manager. |
| 99 ash::MaximizeModeWindowManager* maximize_mode_window_manager() { | 99 ash::MaximizeModeWindowManager* maximize_mode_window_manager() { |
| 100 return Shell::GetInstance()->maximize_mode_controller()-> | 100 return Shell::GetInstance()->maximize_mode_controller()-> |
| 101 maximize_mode_window_manager_.get(); | 101 maximize_mode_window_manager_.get(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 // Resize our desktop. | 104 // Resize our desktop. |
| 105 void ResizeDesktop(int width_delta) { | 105 void ResizeDesktop(int width_delta) { |
| 106 gfx::Size size = | 106 gfx::Size size = |
| 107 gfx::Screen::GetScreen() | 107 display::Screen::GetScreen() |
| 108 ->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()) | 108 ->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()) |
| 109 .size(); | 109 .size(); |
| 110 size.Enlarge(0, width_delta); | 110 size.Enlarge(0, width_delta); |
| 111 UpdateDisplay(size.ToString()); | 111 UpdateDisplay(size.ToString()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 // Create a window in one of the containers which are watched by the | 115 // Create a window in one of the containers which are watched by the |
| 116 // MaximizeModeWindowManager. Note that this only works with one root window. | 116 // MaximizeModeWindowManager. Note that this only works with one root window. |
| 117 // If |can_maximize| is not set, |max_size| is the upper limiting size for | 117 // If |can_maximize| is not set, |max_size| is the upper limiting size for |
| (...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1447 | 1447 |
| 1448 ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); | 1448 ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
| 1449 EXPECT_TRUE(wm::GetWindowState(window.get())->IsDocked()); | 1449 EXPECT_TRUE(wm::GetWindowState(window.get())->IsDocked()); |
| 1450 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 1450 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
| 1451 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); | 1451 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 #endif // OS_WIN | 1454 #endif // OS_WIN |
| 1455 | 1455 |
| 1456 } // namespace ash | 1456 } // namespace ash |
| OLD | NEW |