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

Side by Side Diff: ash/wm/workspace/workspace_manager.cc

Issue 9513004: Switch default WM mode to managed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/root_window_event_filter_unittest.cc ('k') | chrome/browser/extensions/extension_tabs_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698