| 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/screen_ash.h" | 10 #include "ash/screen_util.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/wm/window_properties.h" | 12 #include "ash/wm/window_properties.h" |
| 13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
| 14 #include "ui/aura/client/activation_client.h" | 14 #include "ui/aura/client/activation_client.h" |
| 15 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
| 16 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 18 #include "ui/gfx/display.h" | 18 #include "ui/gfx/display.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "ui/gfx/screen.h" | 20 #include "ui/gfx/screen.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 Shell::GetScreen()->GetDisplayNearestWindow(window); | 64 Shell::GetScreen()->GetDisplayNearestWindow(window); |
| 65 gfx::Rect center = display.work_area(); | 65 gfx::Rect center = display.work_area(); |
| 66 gfx::Size size = window->bounds().size(); | 66 gfx::Size size = window->bounds().size(); |
| 67 if (window_state->IsSnapped()) { | 67 if (window_state->IsSnapped()) { |
| 68 if (window_state->HasRestoreBounds()) | 68 if (window_state->HasRestoreBounds()) |
| 69 size = window_state->GetRestoreBoundsInScreen().size(); | 69 size = window_state->GetRestoreBoundsInScreen().size(); |
| 70 center.ClampToCenteredSize(size); | 70 center.ClampToCenteredSize(size); |
| 71 window_state->SetRestoreBoundsInScreen(center); | 71 window_state->SetRestoreBoundsInScreen(center); |
| 72 window_state->Restore(); | 72 window_state->Restore(); |
| 73 } else { | 73 } else { |
| 74 center = ScreenAsh::ConvertRectFromScreen(window->parent(), | 74 center = ScreenUtil::ConvertRectFromScreen(window->parent(), |
| 75 center); | 75 center); |
| 76 center.ClampToCenteredSize(size); | 76 center.ClampToCenteredSize(size); |
| 77 window->SetBounds(center); | 77 window->SetBounds(center); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, | 81 void AdjustBoundsToEnsureMinimumWindowVisibility(const gfx::Rect& visible_area, |
| 82 gfx::Rect* bounds) { | 82 gfx::Rect* bounds) { |
| 83 AdjustBoundsToEnsureWindowVisibility( | 83 AdjustBoundsToEnsureWindowVisibility( |
| 84 visible_area, kMinimumOnScreenArea, kMinimumOnScreenArea, bounds); | 84 visible_area, kMinimumOnScreenArea, kMinimumOnScreenArea, bounds); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ++i) { | 139 ++i) { |
| 140 ReparentChildWithTransientChildren( | 140 ReparentChildWithTransientChildren( |
| 141 views::corewm::GetTransientChildren(child)[i], | 141 views::corewm::GetTransientChildren(child)[i], |
| 142 old_parent, | 142 old_parent, |
| 143 new_parent); | 143 new_parent); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace wm | 147 } // namespace wm |
| 148 } // namespace ash | 148 } // namespace ash |
| OLD | NEW |