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

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

Issue 9764008: Makes the launcher auto-hide for maximized windows. This turned out to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add null checks and cleanup 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/maximized_workspace.h" 5 #include "ash/wm/workspace/maximized_workspace.h"
6 6
7 #include "ash/screen_ash.h"
7 #include "ash/wm/property_util.h" 8 #include "ash/wm/property_util.h"
8 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
9 #include "ash/wm/workspace/workspace_manager.h" 10 #include "ash/wm/workspace/workspace_manager.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "ui/aura/client/aura_constants.h" 12 #include "ui/aura/client/aura_constants.h"
12 #include "ui/aura/root_window.h" 13 #include "ui/aura/root_window.h"
13 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
14 #include "ui/base/ui_base_types.h" 15 #include "ui/base/ui_base_types.h"
15 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
16 17
(...skipping 13 matching lines...) Expand all
30 } 31 }
31 32
32 void MaximizedWorkspace::OnWindowAddedAfter(aura::Window* window, 33 void MaximizedWorkspace::OnWindowAddedAfter(aura::Window* window,
33 aura::Window* after) { 34 aura::Window* after) {
34 ResetWindowBounds(window); 35 ResetWindowBounds(window);
35 } 36 }
36 37
37 void MaximizedWorkspace::OnWindowRemoved(aura::Window* window) { 38 void MaximizedWorkspace::OnWindowRemoved(aura::Window* window) {
38 } 39 }
39 40
40 void MaximizedWorkspace::OnWorkspaceSizeChanged(const gfx::Rect& old_bounds) {
41 for (size_t i = 0; i < windows().size(); ++i)
42 ResetWindowBounds(windows()[i]);
43 }
44
45 void MaximizedWorkspace::ResetWindowBounds(aura::Window* window) { 41 void MaximizedWorkspace::ResetWindowBounds(aura::Window* window) {
46 if (wm::IsWindowFullscreen(window)) { 42 if (wm::IsWindowFullscreen(window)) {
47 SetWindowBounds(window, 43 SetWindowBounds(window,
48 gfx::Screen::GetMonitorAreaNearestWindow(window)); 44 gfx::Screen::GetMonitorAreaNearestWindow(window));
49 } else { 45 } else {
50 SetWindowBounds(window, bounds()); 46 SetWindowBounds(window, ScreenAsh::GetMaximizedWindowBounds(window));
51 } 47 }
52 } 48 }
53 49
54 } // namespace internal 50 } // namespace internal
55 } // namespace ash 51 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698