| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 // Get the maximze window manager. | 97 // Get the maximze window manager. |
| 98 ash::MaximizeModeWindowManager* maximize_mode_window_manager() { | 98 ash::MaximizeModeWindowManager* maximize_mode_window_manager() { |
| 99 return Shell::GetInstance()->maximize_mode_controller()-> | 99 return Shell::GetInstance()->maximize_mode_controller()-> |
| 100 maximize_mode_window_manager_.get(); | 100 maximize_mode_window_manager_.get(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Resize our desktop. | 103 // Resize our desktop. |
| 104 void ResizeDesktop(int width_delta) { | 104 void ResizeDesktop(int width_delta) { |
| 105 gfx::Size size = Shell::GetScreen()->GetDisplayNearestWindow( | 105 gfx::Size size = |
| 106 Shell::GetPrimaryRootWindow()).size(); | 106 gfx::Screen::GetScreen() |
| 107 ->GetDisplayNearestWindow(Shell::GetPrimaryRootWindow()) |
| 108 .size(); |
| 107 size.Enlarge(0, width_delta); | 109 size.Enlarge(0, width_delta); |
| 108 UpdateDisplay(size.ToString()); | 110 UpdateDisplay(size.ToString()); |
| 109 } | 111 } |
| 110 | 112 |
| 111 private: | 113 private: |
| 112 // Create a window in one of the containers which are watched by the | 114 // Create a window in one of the containers which are watched by the |
| 113 // MaximizeModeWindowManager. Note that this only works with one root window. | 115 // MaximizeModeWindowManager. Note that this only works with one root window. |
| 114 // If |can_maximize| is not set, |max_size| is the upper limiting size for | 116 // If |can_maximize| is not set, |max_size| is the upper limiting size for |
| 115 // the window, whereas an empty size means that there is no limit. | 117 // the window, whereas an empty size means that there is no limit. |
| 116 aura::Window* CreateWindowInWatchedContainer(ui::wm::WindowType type, | 118 aura::Window* CreateWindowInWatchedContainer(ui::wm::WindowType type, |
| (...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 | 1413 |
| 1412 ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); | 1414 ash::MaximizeModeWindowManager* manager = CreateMaximizeModeWindowManager(); |
| 1413 EXPECT_TRUE(wm::GetWindowState(window.get())->IsDocked()); | 1415 EXPECT_TRUE(wm::GetWindowState(window.get())->IsDocked()); |
| 1414 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); | 1416 EXPECT_FALSE(wm::GetWindowState(window.get())->IsMaximized()); |
| 1415 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); | 1417 EXPECT_EQ(0, manager->GetNumberOfManagedWindows()); |
| 1416 } | 1418 } |
| 1417 | 1419 |
| 1418 #endif // OS_WIN | 1420 #endif // OS_WIN |
| 1419 | 1421 |
| 1420 } // namespace ash | 1422 } // namespace ash |
| OLD | NEW |