Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: ash/wm/base_layout_manager.cc

Issue 10910164: Removes the grid from ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ShelfBrowserTest Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/base_layout_manager.h ('k') | ash/wm/base_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « ash/wm/base_layout_manager.h ('k') | ash/wm/base_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698