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

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

Issue 16093036: Do not create a workspace for a maximized window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 7 years, 6 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 #ifndef ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_ 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_
6 #define ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_ 6 #define ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // implicitly created as windows are maximized (or made fullscreen), and 51 // implicitly created as windows are maximized (or made fullscreen), and
52 // destroyed when maximized windows are closed or restored. There is always one 52 // destroyed when maximized windows are closed or restored. There is always one
53 // workspace for the desktop. 53 // workspace for the desktop.
54 // Internally WorkspaceManager creates a Window for each Workspace. As windows 54 // Internally WorkspaceManager creates a Window for each Workspace. As windows
55 // are maximized and restored they are reparented to the right Window. 55 // are maximized and restored they are reparented to the right Window.
56 class ASH_EXPORT WorkspaceManager : public ash::ShellObserver { 56 class ASH_EXPORT WorkspaceManager : public ash::ShellObserver {
57 public: 57 public:
58 explicit WorkspaceManager(aura::Window* viewport); 58 explicit WorkspaceManager(aura::Window* viewport);
59 virtual ~WorkspaceManager(); 59 virtual ~WorkspaceManager();
60 60
61 // Returns true if |window| is considered maximized and should exist in its 61 // Returns true if |window| is minimized and will restore to a window which
62 // own workspace. 62 // exists in its own workspace.
63 static bool IsMaximized(aura::Window* window); 63 static bool WillRestoreToWorkspace(aura::Window* window);
64 static bool IsMaximizedState(ui::WindowShowState state);
65
66 // Returns true if |window| is minimized and will restore to a maximized
67 // window.
68 static bool WillRestoreMaximized(aura::Window* window);
69 64
70 // Returns the current window state. 65 // Returns the current window state.
71 WorkspaceWindowState GetWindowState() const; 66 WorkspaceWindowState GetWindowState() const;
72 67
73 void SetShelf(ShelfLayoutManager* shelf); 68 void SetShelf(ShelfLayoutManager* shelf);
74 69
75 // Activates the workspace containing |window|. Does nothing if |window| is 70 // Activates the workspace containing |window|. Does nothing if |window| is
76 // NULL or not contained in a workspace. 71 // NULL or not contained in a workspace.
77 void SetActiveWorkspaceByWindow(aura::Window* window); 72 void SetActiveWorkspaceByWindow(aura::Window* window);
78 73
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 gfx::Rect GetWorkAreaBounds() const; 145 gfx::Rect GetWorkAreaBounds() const;
151 146
152 // Returns an iterator into |workspaces_| for |workspace|. 147 // Returns an iterator into |workspaces_| for |workspace|.
153 Workspaces::iterator FindWorkspace(Workspace* workspace); 148 Workspaces::iterator FindWorkspace(Workspace* workspace);
154 149
155 Workspace* desktop_workspace() { return workspaces_[0]; } 150 Workspace* desktop_workspace() { return workspaces_[0]; }
156 const Workspace* desktop_workspace() const { return workspaces_[0]; } 151 const Workspace* desktop_workspace() const { return workspaces_[0]; }
157 152
158 // Creates a new workspace. The Workspace is not added to anything and is 153 // Creates a new workspace. The Workspace is not added to anything and is
159 // owned by the caller. 154 // owned by the caller.
160 Workspace* CreateWorkspace(bool maximized); 155 Workspace* CreateWorkspace(bool fullscren);
161 156
162 // Moves all the non-maximized child windows of |workspace| to the desktop 157 // Moves all the non-maximized child windows of |workspace| to the desktop
163 // stacked beneath |stack_beneath| (if non-NULL). After moving child windows 158 // stacked beneath |stack_beneath| (if non-NULL). After moving child windows
164 // if |workspace| contains no children it is deleted, otherwise it it moved to 159 // if |workspace| contains no children it is deleted, otherwise it it moved to
165 // |pending_workspaces_|. 160 // |pending_workspaces_|.
166 void MoveWorkspaceToPendingOrDelete(Workspace* workspace, 161 void MoveWorkspaceToPendingOrDelete(Workspace* workspace,
167 aura::Window* stack_beneath, 162 aura::Window* stack_beneath,
168 SwitchReason reason); 163 SwitchReason reason);
169 164
170 // Moves the children of |window| to the desktop. This excludes certain 165 // Moves the children of |window| to the desktop. This excludes certain
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // finger vertical scroll. 273 // finger vertical scroll.
279 scoped_ptr<WorkspaceCycler> workspace_cycler_; 274 scoped_ptr<WorkspaceCycler> workspace_cycler_;
280 275
281 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); 276 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
282 }; 277 };
283 278
284 } // namespace internal 279 } // namespace internal
285 } // namespace ash 280 } // namespace ash
286 281
287 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_ 282 #endif // ASH_WM_WORKSPACE_WORKSPACE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698