| 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/default_state.h" | 5 #include "ash/wm/default_state.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/screen_util.h" | 8 #include "ash/screen_util.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/coordinate_conversion.h" | 11 #include "ash/wm/coordinate_conversion.h" |
| 12 #include "ash/wm/window_animations.h" | 12 #include "ash/wm/window_animations.h" |
| 13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
| 14 #include "ash/wm/window_state_delegate.h" | 14 #include "ash/wm/window_state_delegate.h" |
| 15 #include "ash/wm/window_util.h" | 15 #include "ash/wm/window_util.h" |
| 16 #include "ash/wm/workspace/workspace_window_resizer.h" | 16 #include "ash/wm/workspace/workspace_window_resizer.h" |
| 17 #include "ui/aura/client/aura_constants.h" | 17 #include "ui/aura/client/aura_constants.h" |
| 18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
| 19 #include "ui/aura/window_delegate.h" | 19 #include "ui/aura/window_delegate.h" |
| 20 #include "ui/gfx/display.h" | 20 #include "ui/gfx/display.h" |
| 21 #include "ui/gfx/rect.h" | 21 #include "ui/gfx/rect.h" |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 namespace wm { | 24 namespace wm { |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 bool IsPanel(aura::Window* window) { | 27 bool IsPanel(aura::Window* window) { |
| 28 return window->parent() && | 28 return window->parent() && |
| 29 window->parent()->id() == internal::kShellWindowId_DockedContainer; | 29 window->parent()->id() == internal::kShellWindowId_PanelContainer; |
| 30 } | 30 } |
| 31 | 31 |
| 32 gfx::Rect BoundsWithScreenEdgeVisible( | 32 gfx::Rect BoundsWithScreenEdgeVisible( |
| 33 aura::Window* window, | 33 aura::Window* window, |
| 34 const gfx::Rect& restore_bounds) { | 34 const gfx::Rect& restore_bounds) { |
| 35 gfx::Rect max_bounds = | 35 gfx::Rect max_bounds = |
| 36 ash::ScreenUtil::GetMaximizedWindowBoundsInParent(window); | 36 ash::ScreenUtil::GetMaximizedWindowBoundsInParent(window); |
| 37 // If the restore_bounds are more than 1 grid step away from the size the | 37 // If the restore_bounds are more than 1 grid step away from the size the |
| 38 // window would be when maximized, inset it. | 38 // window would be when maximized, inset it. |
| 39 max_bounds.Inset(ash::internal::WorkspaceWindowResizer::kScreenEdgeInset, | 39 max_bounds.Inset(ash::internal::WorkspaceWindowResizer::kScreenEdgeInset, |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if (window_state->IsNormalShowState()) | 359 if (window_state->IsNormalShowState()) |
| 360 window_state->ClearRestoreBounds(); | 360 window_state->ClearRestoreBounds(); |
| 361 | 361 |
| 362 // Set the restore rectangle to the previously set restore rectangle. | 362 // Set the restore rectangle to the previously set restore rectangle. |
| 363 if (!restore.IsEmpty()) | 363 if (!restore.IsEmpty()) |
| 364 window_state->SetRestoreBoundsInScreen(restore); | 364 window_state->SetRestoreBoundsInScreen(restore); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace wm | 367 } // namespace wm |
| 368 } // namespace ash | 368 } // namespace ash |
| OLD | NEW |