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

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

Issue 10444014: ash: Improved window maximize/restore animations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix lock screen, app windows Created 8 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
« no previous file with comments | « ash/wm/workspace/workspace.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MANAGER_H_ 5 #ifndef ASH_WM_WORKSPACE_MANAGER_H_
6 #define ASH_WM_WORKSPACE_MANAGER_H_ 6 #define ASH_WM_WORKSPACE_MANAGER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Returns the Window this WorkspaceManager controls. 69 // Returns the Window this WorkspaceManager controls.
70 aura::Window* contents_view() { return contents_view_; } 70 aura::Window* contents_view() { return contents_view_; }
71 71
72 // Returns the window for rotate operation based on the |location|. 72 // Returns the window for rotate operation based on the |location|.
73 // TODO: this isn't currently used; remove if we do away with overview. 73 // TODO: this isn't currently used; remove if we do away with overview.
74 aura::Window* FindRotateWindowForLocation(const gfx::Point& location); 74 aura::Window* FindRotateWindowForLocation(const gfx::Point& location);
75 75
76 // Returns the bounds in which a window can be moved/resized. 76 // Returns the bounds in which a window can be moved/resized.
77 gfx::Rect GetDragAreaBounds(); 77 gfx::Rect GetDragAreaBounds();
78 78
79 // Returns the window the layout manager should allow the size to be set for.
80 // TODO: maybe this should be set on WorkspaceLayoutManager.
81 aura::Window* ignored_window() { return ignored_window_; }
82
83 // Sets the size of the grid. Newly added windows are forced to align to the 79 // Sets the size of the grid. Newly added windows are forced to align to the
84 // size of the grid. 80 // size of the grid.
85 void set_grid_size(int size) { grid_size_ = size; } 81 void set_grid_size(int size) { grid_size_ = size; }
86 int grid_size() const { return grid_size_; } 82 int grid_size() const { return grid_size_; }
87 83
88 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } 84 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; }
89 85
90 // Updates the visibility and whether any windows overlap the shelf. 86 // Updates the visibility and whether any windows overlap the shelf.
91 void UpdateShelfVisibility(); 87 void UpdateShelfVisibility();
92 88
93 // Returns the current window state. 89 // Returns the current window state.
94 WindowState GetWindowState(); 90 WindowState GetWindowState();
95 91
96 // Invoked when the show state of the specified window changes. 92 // Invoked when the show state of the specified window changes.
97 void ShowStateChanged(aura::Window* window); 93 void ShowStateChanged(aura::Window* window);
98 94
99 private: 95 private:
100 // Enumeration of whether windows should animate or not. 96 // Enumeration of whether windows should animate or not.
101 enum AnimateChangeType { 97 enum AnimateChangeType {
102 ANIMATE, 98 ANIMATE,
103 DONT_ANIMATE 99 DONT_ANIMATE
104 }; 100 };
105 101
106 friend class Workspace; 102 friend class Workspace;
107 friend class WorkspaceManagerTest; 103 friend class WorkspaceManagerTest;
108 104
109 // See description above getter.
110 void set_ignored_window(aura::Window* ignored_window) {
111 ignored_window_ = ignored_window;
112 }
113
114 void AddWorkspace(Workspace* workspace); 105 void AddWorkspace(Workspace* workspace);
115 void RemoveWorkspace(Workspace* workspace); 106 void RemoveWorkspace(Workspace* workspace);
116 107
117 // Sets the visibility of the windows in |workspace|. 108 // Sets the visibility of the windows in |workspace|.
118 void SetVisibilityOfWorkspaceWindows(Workspace* workspace, 109 void SetVisibilityOfWorkspaceWindows(Workspace* workspace,
119 AnimateChangeType change_type, 110 AnimateChangeType change_type,
120 bool value); 111 bool value);
121 112
122 // Implementation of SetVisibilityOfWorkspaceWindows(). 113 // Implementation of SetVisibilityOfWorkspaceWindows().
123 void SetWindowLayerVisibility(const std::vector<aura::Window*>& windows, 114 void SetWindowLayerVisibility(const std::vector<aura::Window*>& windows,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 146
156 // Deletes workspaces of TYPE_MAXIMIZED when they become empty. 147 // Deletes workspaces of TYPE_MAXIMIZED when they become empty.
157 void CleanupWorkspace(Workspace* workspace); 148 void CleanupWorkspace(Workspace* workspace);
158 149
159 aura::Window* contents_view_; 150 aura::Window* contents_view_;
160 151
161 Workspace* active_workspace_; 152 Workspace* active_workspace_;
162 153
163 std::vector<Workspace*> workspaces_; 154 std::vector<Workspace*> workspaces_;
164 155
165 // The window that WorkspaceManager does not set the bounds on. 156 // Window being maximized or restored during a workspace type change.
166 aura::Window* ignored_window_; 157 // It has its own animation and is ignored by workspace show/hide animations.
158 aura::Window* maximize_restore_window_;
167 159
168 // See description above setter. 160 // See description above setter.
169 int grid_size_; 161 int grid_size_;
170 162
171 // Owned by the Shell container window LauncherContainer. May be NULL. 163 // Owned by the Shell container window LauncherContainer. May be NULL.
172 ShelfLayoutManager* shelf_; 164 ShelfLayoutManager* shelf_;
173 165
174 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); 166 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
175 }; 167 };
176 168
177 } // namespace internal 169 } // namespace internal
178 } // namespace ash 170 } // namespace ash
179 171
180 #endif // ASH_WM_WORKSPACE_MANAGER_H_ 172 #endif // ASH_WM_WORKSPACE_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698