OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/workspace/workspace_manager.h" | 5 #include "ash/wm/workspace/workspace_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 void WorkspaceManager::SetOverview(bool overview) { | 180 void WorkspaceManager::SetOverview(bool overview) { |
181 if (is_overview_ == overview) | 181 if (is_overview_ == overview) |
182 return; | 182 return; |
183 NOTIMPLEMENTED(); | 183 NOTIMPLEMENTED(); |
184 } | 184 } |
185 | 185 |
186 void WorkspaceManager::SetWorkspaceSize(const gfx::Size& workspace_size) { | 186 void WorkspaceManager::SetWorkspaceSize(const gfx::Size& workspace_size) { |
187 if (workspace_size == workspace_size_) | 187 if (workspace_size == workspace_size_) |
188 return; | 188 return; |
189 workspace_size_ = workspace_size; | 189 workspace_size_ = workspace_size; |
| 190 SetWorkspaceBounds(); |
| 191 } |
| 192 |
| 193 void WorkspaceManager::SetWorkspaceBounds() { |
190 for (Workspaces::const_iterator i = workspaces_.begin(); | 194 for (Workspaces::const_iterator i = workspaces_.begin(); |
191 i != workspaces_.end(); ++i) { | 195 i != workspaces_.end(); ++i) { |
192 (*i)->SetBounds(GetWorkAreaBounds()); | 196 (*i)->SetBounds(GetWorkAreaBounds()); |
193 } | 197 } |
194 } | 198 } |
195 | 199 |
196 gfx::Rect WorkspaceManager::AlignBoundsToGrid(const gfx::Rect& bounds) { | 200 gfx::Rect WorkspaceManager::AlignBoundsToGrid(const gfx::Rect& bounds) { |
197 if (grid_size_ <= 1) | 201 if (grid_size_ <= 1) |
198 return bounds; | 202 return bounds; |
199 return AlignRectToGrid(bounds, grid_size_); | 203 return AlignRectToGrid(bounds, grid_size_); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 if (type == Workspace::TYPE_MAXIMIZED) | 420 if (type == Workspace::TYPE_MAXIMIZED) |
417 workspace = new MaximizedWorkspace(this); | 421 workspace = new MaximizedWorkspace(this); |
418 else | 422 else |
419 workspace = new ManagedWorkspace(this); | 423 workspace = new ManagedWorkspace(this); |
420 AddWorkspace(workspace); | 424 AddWorkspace(workspace); |
421 return workspace; | 425 return workspace; |
422 } | 426 } |
423 | 427 |
424 } // namespace internal | 428 } // namespace internal |
425 } // namespace ash | 429 } // namespace ash |
OLD | NEW |