| 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/window_util.h" | 5 #include "ash/wm/window_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 void CenterWindow(aura::Window* window) { | 57 void CenterWindow(aura::Window* window) { |
| 58 const gfx::Display display = | 58 const gfx::Display display = |
| 59 Shell::GetScreen()->GetDisplayNearestWindow(window); | 59 Shell::GetScreen()->GetDisplayNearestWindow(window); |
| 60 gfx::Rect center = display.work_area(); | 60 gfx::Rect center = display.work_area(); |
| 61 center.ClampToCenteredSize(window->bounds().size()); | 61 center.ClampToCenteredSize(window->bounds().size()); |
| 62 window->SetBoundsInScreen(center, display); | 62 window->SetBoundsInScreen(center, display); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void SetAnimateToFullscreen(aura::Window* window, bool animate) { | |
| 66 window->SetProperty(ash::internal::kAnimateToFullscreenKey, animate); | |
| 67 } | |
| 68 | |
| 69 void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, | 65 void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, |
| 70 gfx::Rect* bounds) { | 66 gfx::Rect* bounds) { |
| 71 AdjustBoundsToEnsureWindowVisibility( | 67 AdjustBoundsToEnsureWindowVisibility( |
| 72 visible_area, kMinimumOnScreenArea, kMinimumOnScreenArea, bounds); | 68 visible_area, kMinimumOnScreenArea, kMinimumOnScreenArea, bounds); |
| 73 } | 69 } |
| 74 | 70 |
| 75 void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& visible_area, | 71 void AdjustBoundsToEnsureWindowVisibility(const gfx::Rect& visible_area, |
| 76 int min_width, | 72 int min_width, |
| 77 int min_height, | 73 int min_height, |
| 78 gfx::Rect* bounds) { | 74 gfx::Rect* bounds) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } | 114 } |
| 119 | 115 |
| 120 void ReparentTransientChildrenOfChild(aura::Window* window, | 116 void ReparentTransientChildrenOfChild(aura::Window* window, |
| 121 aura::Window* child) { | 117 aura::Window* child) { |
| 122 for (size_t i = 0; i < child->transient_children().size(); ++i) | 118 for (size_t i = 0; i < child->transient_children().size(); ++i) |
| 123 ReparentChildWithTransientChildren(window, child->transient_children()[i]); | 119 ReparentChildWithTransientChildren(window, child->transient_children()[i]); |
| 124 } | 120 } |
| 125 | 121 |
| 126 } // namespace wm | 122 } // namespace wm |
| 127 } // namespace ash | 123 } // namespace ash |
| OLD | NEW |