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/base_layout_manager.h" | 5 #include "ash/wm/base_layout_manager.h" |
6 | 6 |
7 #include "ash/screen_ash.h" | 7 #include "ash/screen_ash.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/property_util.h" | 9 #include "ash/wm/property_util.h" |
10 #include "ash/wm/shelf_layout_manager.h" | 10 #include "ash/wm/shelf_layout_manager.h" |
11 #include "ash/wm/window_animations.h" | 11 #include "ash/wm/window_animations.h" |
12 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
13 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
16 #include "ui/aura/window_property.h" | 16 #include "ui/aura/window_property.h" |
17 #include "ui/base/ui_base_types.h" | 17 #include "ui/base/ui_base_types.h" |
18 #include "ui/gfx/compositor/layer.h" | 18 #include "ui/compositor/layer.h" |
19 #include "ui/gfx/screen.h" | 19 #include "ui/gfx/screen.h" |
20 | 20 |
21 DECLARE_WINDOW_PROPERTY_TYPE(ui::WindowShowState) | 21 DECLARE_WINDOW_PROPERTY_TYPE(ui::WindowShowState) |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Given a |window| and tentative |restore_bounds|, returns new bounds that | 25 // Given a |window| and tentative |restore_bounds|, returns new bounds that |
26 // ensure that at least a few pixels of the screen background are visible | 26 // ensure that at least a few pixels of the screen background are visible |
27 // outside the edges of the window. Use this to ensure that restoring a | 27 // outside the edges of the window. Use this to ensure that restoring a |
28 // maximized window creates enough space that the resize handles are easily | 28 // maximized window creates enough space that the resize handles are easily |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 gfx::Rect monitor_rect = | 223 gfx::Rect monitor_rect = |
224 gfx::Screen::GetMonitorNearestWindow(window).work_area(); | 224 gfx::Screen::GetMonitorNearestWindow(window).work_area(); |
225 // Put as much of the window as possible within the monitor area. | 225 // Put as much of the window as possible within the monitor area. |
226 window->SetBounds(window->bounds().AdjustToFit(monitor_rect)); | 226 window->SetBounds(window->bounds().AdjustToFit(monitor_rect)); |
227 } | 227 } |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 } // namespace internal | 231 } // namespace internal |
232 } // namespace ash | 232 } // namespace ash |
OLD | NEW |