| 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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 ignored_window_ = NULL; | 336 ignored_window_ = NULL; |
| 337 } | 337 } |
| 338 | 338 |
| 339 void WorkspaceManager::SetWindowBoundsFromRestoreBounds(aura::Window* window) { | 339 void WorkspaceManager::SetWindowBoundsFromRestoreBounds(aura::Window* window) { |
| 340 const gfx::Rect* restore = GetRestoreBounds(window); | 340 const gfx::Rect* restore = GetRestoreBounds(window); |
| 341 gfx::Rect bounds; | 341 gfx::Rect bounds; |
| 342 if (restore) | 342 if (restore) |
| 343 bounds = restore->AdjustToFit(GetWorkAreaBounds()); | 343 bounds = restore->AdjustToFit(GetWorkAreaBounds()); |
| 344 else | 344 else |
| 345 bounds = window->bounds().AdjustToFit(GetWorkAreaBounds()); | 345 bounds = window->bounds().AdjustToFit(GetWorkAreaBounds()); |
| 346 SetWindowBounds(window, AlignRectToGrid(bounds, grid_size_)); | 346 SetWindowBounds(window, bounds); |
| 347 ash::ClearRestoreBounds(window); | 347 ash::ClearRestoreBounds(window); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void WorkspaceManager::SetFullScreenOrMaximizedBounds(aura::Window* window) { | 350 void WorkspaceManager::SetFullScreenOrMaximizedBounds(aura::Window* window) { |
| 351 if (!GetRestoreBounds(window)) | 351 if (!GetRestoreBounds(window)) |
| 352 SetRestoreBounds(window, window->GetTargetBounds()); | 352 SetRestoreBounds(window, window->GetTargetBounds()); |
| 353 if (wm::IsWindowMaximized(window)) | 353 if (wm::IsWindowMaximized(window)) |
| 354 SetWindowBounds(window, GetWorkAreaBounds()); | 354 SetWindowBounds(window, GetWorkAreaBounds()); |
| 355 else if (wm::IsWindowFullscreen(window)) | 355 else if (wm::IsWindowFullscreen(window)) |
| 356 SetWindowBounds(window, gfx::Screen::GetMonitorAreaNearestWindow(window)); | 356 SetWindowBounds(window, gfx::Screen::GetMonitorAreaNearestWindow(window)); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 if (type == Workspace::TYPE_MAXIMIZED) | 406 if (type == Workspace::TYPE_MAXIMIZED) |
| 407 workspace = new MaximizedWorkspace(this); | 407 workspace = new MaximizedWorkspace(this); |
| 408 else | 408 else |
| 409 workspace = new ManagedWorkspace(this); | 409 workspace = new ManagedWorkspace(this); |
| 410 AddWorkspace(workspace); | 410 AddWorkspace(workspace); |
| 411 return workspace; | 411 return workspace; |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace internal | 414 } // namespace internal |
| 415 } // namespace ash | 415 } // namespace ash |
| OLD | NEW |