| Index: ash/wm/base_layout_manager.cc
|
| diff --git a/ash/wm/base_layout_manager.cc b/ash/wm/base_layout_manager.cc
|
| index 974944459d0605ecca200287bd6319e35b52d22d..2f2ffb42f2d3b9637cb9e9536849345dfc4b12ae 100644
|
| --- a/ash/wm/base_layout_manager.cc
|
| +++ b/ash/wm/base_layout_manager.cc
|
| @@ -12,6 +12,7 @@
|
| #include "ash/wm/window_properties.h"
|
| #include "ash/wm/window_util.h"
|
| #include "ash/wm/workspace_controller.h"
|
| +#include "ash/wm/workspace/workspace_window_resizer.h"
|
| #include "base/command_line.h"
|
| #include "ui/aura/client/aura_constants.h"
|
| #include "ui/aura/root_window.h"
|
| @@ -20,30 +21,6 @@
|
| #include "ui/compositor/layer.h"
|
| #include "ui/gfx/screen.h"
|
|
|
| -namespace {
|
| -
|
| -// Given a |window| and tentative |restore_bounds|, returns new bounds that
|
| -// ensure that at least a few pixels of the screen background are visible
|
| -// outside the edges of the window. Use this to ensure that restoring a
|
| -// maximized window creates enough space that the resize handles are easily
|
| -// clickable. We get into this state when updating Chrome OS R18 to R19, as
|
| -// Chrome OS R18 and earlier used only maximized windows and set their restore
|
| -// bounds to the size of the screen. See crbug.com/108073
|
| -gfx::Rect BoundsWithScreenEdgeVisible(aura::Window* window,
|
| - const gfx::Rect& restore_bounds) {
|
| - // If the restore_bounds are more than 1 grid step away from the size the
|
| - // window would be when maximized, inset it.
|
| - int grid_size = ash::Shell::GetInstance()->GetGridSize();
|
| - gfx::Rect max_bounds =
|
| - ash::ScreenAsh::GetMaximizedWindowBoundsInParent(window);
|
| - max_bounds.Inset(grid_size, grid_size);
|
| - if (restore_bounds.Contains(max_bounds))
|
| - return max_bounds;
|
| - return restore_bounds;
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| namespace ash {
|
| namespace internal {
|
|
|
| @@ -67,6 +44,21 @@ BaseLayoutManager::~BaseLayoutManager() {
|
| Shell::GetInstance()->RemoveShellObserver(this);
|
| }
|
|
|
| +// static
|
| +gfx::Rect BaseLayoutManager::BoundsWithScreenEdgeVisible(
|
| + aura::Window* window,
|
| + const gfx::Rect& restore_bounds) {
|
| + gfx::Rect max_bounds =
|
| + ash::ScreenAsh::GetMaximizedWindowBoundsInParent(window);
|
| + // If the restore_bounds are more than 1 grid step away from the size the
|
| + // window would be when maximized, inset it.
|
| + max_bounds.Inset(ash::internal::WorkspaceWindowResizer::kScreenEdgeInset,
|
| + ash::internal::WorkspaceWindowResizer::kScreenEdgeInset);
|
| + if (restore_bounds.Contains(max_bounds))
|
| + return max_bounds;
|
| + return restore_bounds;
|
| +}
|
| +
|
| /////////////////////////////////////////////////////////////////////////////
|
| // BaseLayoutManager, LayoutManager overrides:
|
|
|
|
|