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

Unified Diff: ash/wm/workspace/workspace_layout_manager2.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/workspace/workspace_event_filter_unittest.cc ('k') | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_layout_manager2.cc
diff --git a/ash/wm/workspace/workspace_layout_manager2.cc b/ash/wm/workspace/workspace_layout_manager2.cc
index b19041c5f32a49aaa5a9ed9e4298f12f9f1f81ff..040ae9b9c8874a5367463e066007dea472a148d6 100644
--- a/ash/wm/workspace/workspace_layout_manager2.cc
+++ b/ash/wm/workspace/workspace_layout_manager2.cc
@@ -8,11 +8,13 @@
#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/wm/always_on_top_controller.h"
+#include "ash/wm/base_layout_manager.h"
#include "ash/wm/window_animations.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/workspace2.h"
#include "ash/wm/workspace/workspace_manager2.h"
+#include "ash/wm/workspace/workspace_window_resizer.h"
#include "base/auto_reset.h"
#include "base/command_line.h"
#include "ui/aura/client/aura_constants.h"
@@ -27,25 +29,6 @@ using aura::Window;
namespace ash {
namespace internal {
-namespace {
-
-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->parent()->parent());
- max_bounds.Inset(grid_size, grid_size);
- // TODO(sky): this looks totally wrong!
- if (restore_bounds.Contains(max_bounds))
- return max_bounds;
- return restore_bounds;
-}
-
-} // namespace
-
WorkspaceLayoutManager2::WorkspaceLayoutManager2(Workspace2* workspace)
: root_window_(workspace->window()->GetRootWindow()),
workspace_(workspace),
@@ -233,9 +216,11 @@ void WorkspaceLayoutManager2::UpdateBoundsFromShowState(Window* window) {
gfx::Rect bounds_in_parent =
ScreenAsh::ConvertRectFromScreen(window->parent()->parent(),
*restore);
- SetChildBoundsDirect(window,
- BoundsWithScreenEdgeVisible(window,
- bounds_in_parent));
+ SetChildBoundsDirect(
+ window,
+ BaseLayoutManager::BoundsWithScreenEdgeVisible(
+ window->parent()->parent(),
+ bounds_in_parent));
}
window->ClearProperty(aura::client::kRestoreBoundsKey);
break;
« no previous file with comments | « ash/wm/workspace/workspace_event_filter_unittest.cc ('k') | ash/wm/workspace/workspace_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698