summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 01:40:44 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-15 01:40:44 +0000
commit2faf2ce776c4094e0e4b3d456ff7b4eb44bb58bf (patch)
tree331442bf1a602d7d4fb4628b56dc1d6f1a50a0ed
parent64a7103a30ca65a8256f9ad0c55af95d21a5f275 (diff)
downloadchromium_src-2faf2ce776c4094e0e4b3d456ff7b4eb44bb58bf.zip
chromium_src-2faf2ce776c4094e0e4b3d456ff7b4eb44bb58bf.tar.gz
chromium_src-2faf2ce776c4094e0e4b3d456ff7b4eb44bb58bf.tar.bz2
Change WorkspaceLayoutManager::SetChildBounds to pass through any
size. Looks like we're not going to do the full managed window manager, so this code doesn't make sense. BUG=none TEST=none R=oshima@chromium.org Review URL: http://codereview.chromium.org/9387021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121997 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/wm/workspace/workspace_layout_manager.cc18
-rw-r--r--ash/wm/workspace/workspace_manager_unittest.cc5
2 files changed, 7 insertions, 16 deletions
diff --git a/ash/wm/workspace/workspace_layout_manager.cc b/ash/wm/workspace/workspace_layout_manager.cc
index d9995d8c..a705059 100644
--- a/ash/wm/workspace/workspace_layout_manager.cc
+++ b/ash/wm/workspace/workspace_layout_manager.cc
@@ -85,6 +85,7 @@ void WorkspaceLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
SetChildBoundsDirect(child,
gfx::Screen::GetMonitorAreaNearestWindow(child));
} else {
+ // Align non-maximized/fullscreen windows to a grid.
SetChildBoundsDirect(
child, workspace_manager_->AlignBoundsToGrid(child->GetTargetBounds()));
}
@@ -110,17 +111,12 @@ void WorkspaceLayoutManager::OnChildWindowVisibilityChanged(
void WorkspaceLayoutManager::SetChildBounds(
aura::Window* child,
const gfx::Rect& requested_bounds) {
- if (child == workspace_manager_->ignored_window() ||
- !workspace_manager_->IsManagedWindow(child)) {
- // Allow requests for |ignored_window_| or unmanaged windows.
- SetChildBoundsDirect(child, requested_bounds);
- } else if (!window_util::IsWindowMaximized(child) &&
- !window_util::IsWindowFullscreen(child)) {
- // Align normal windows to the grid.
- SetChildBoundsDirect(
- child, workspace_manager_->AlignBoundsToGrid(requested_bounds));
- }
- // All other requests we ignore.
+ gfx::Rect child_bounds(requested_bounds);
+ if (window_util::IsWindowMaximized(child))
+ child_bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow(child);
+ else if (window_util::IsWindowFullscreen(child))
+ child_bounds = gfx::Screen::GetMonitorAreaNearestWindow(child);
+ SetChildBoundsDirect(child, child_bounds);
}
} // namespace internal
diff --git a/ash/wm/workspace/workspace_manager_unittest.cc b/ash/wm/workspace/workspace_manager_unittest.cc
index a7ba3be..90db9b0 100644
--- a/ash/wm/workspace/workspace_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_manager_unittest.cc
@@ -355,11 +355,6 @@ TEST_F(WorkspaceManagerTest, SnapToGrid) {
w1->SetBounds(gfx::Rect(1, 6, 25, 30));
w1->SetParent(viewport());
EXPECT_EQ(gfx::Rect(0, 8, 24, 32), w1->bounds());
-
- // Verify snap to grid when bounds are set after parented.
- w1.reset(CreateTestWindow());
- w1->SetBounds(gfx::Rect(1, 6, 25, 30));
- EXPECT_EQ(gfx::Rect(0, 8, 24, 32), w1->bounds());
}
// Assertions around a fullscreen window.