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

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

Issue 9558004: Makes windows no longer open maximized by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk 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
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.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 15 matching lines...) Expand all
26 26
27 namespace ash { 27 namespace ash {
28 namespace internal { 28 namespace internal {
29 29
30 class ShelfLayoutManager; 30 class ShelfLayoutManager;
31 class WorkspaceManagerTest; 31 class WorkspaceManagerTest;
32 32
33 // WorkspaceManager manages multiple workspaces in the desktop. 33 // WorkspaceManager manages multiple workspaces in the desktop.
34 class ASH_EXPORT WorkspaceManager : public aura::WindowObserver{ 34 class ASH_EXPORT WorkspaceManager : public aura::WindowObserver{
35 public: 35 public:
36 // If open_new_windows_maximized() is true and the size of the viewport is
37 // smaller than this value, newly created windows are forced maximized.
38 static const int kOpenMaximizedThreshold;
39
40 explicit WorkspaceManager(aura::Window* viewport); 36 explicit WorkspaceManager(aura::Window* viewport);
41 virtual ~WorkspaceManager(); 37 virtual ~WorkspaceManager();
42 38
43 // Returns true if |window| should be managed by the WorkspaceManager. 39 // Returns true if |window| should be managed by the WorkspaceManager.
44 bool IsManagedWindow(aura::Window* window) const; 40 bool IsManagedWindow(aura::Window* window) const;
45 41
46 // Returns true if |window| should be maximized.
47 bool ShouldMaximize(aura::Window* window) const;
48
49 // Adds/removes a window creating/destroying workspace as necessary. 42 // Adds/removes a window creating/destroying workspace as necessary.
50 void AddWindow(aura::Window* window); 43 void AddWindow(aura::Window* window);
51 void RemoveWindow(aura::Window* window); 44 void RemoveWindow(aura::Window* window);
52 45
53 // Activates the workspace containing |window|. Does nothing if |window| is 46 // Activates the workspace containing |window|. Does nothing if |window| is
54 // NULL or not contained in a workspace. 47 // NULL or not contained in a workspace.
55 void SetActiveWorkspaceByWindow(aura::Window* window); 48 void SetActiveWorkspaceByWindow(aura::Window* window);
56 49
57 // Returns the Window this WorkspaceManager controls. 50 // Returns the Window this WorkspaceManager controls.
58 aura::Window* contents_view() { return contents_view_; } 51 aura::Window* contents_view() { return contents_view_; }
59 52
60 // Returns the window for rotate operation based on the |location|. 53 // Returns the window for rotate operation based on the |location|.
61 // TODO: this isn't currently used; remove if we do away with overview. 54 // TODO: this isn't currently used; remove if we do away with overview.
62 aura::Window* FindRotateWindowForLocation(const gfx::Point& location); 55 aura::Window* FindRotateWindowForLocation(const gfx::Point& location);
63 56
64 // Returns the bounds in which a window can be moved/resized. 57 // Returns the bounds in which a window can be moved/resized.
65 gfx::Rect GetDragAreaBounds(); 58 gfx::Rect GetDragAreaBounds();
66 59
67 // Turn on/off overview mode. 60 // Turn on/off overview mode.
68 void SetOverview(bool overview); 61 void SetOverview(bool overview);
69 bool is_overview() const { return is_overview_; } 62 bool is_overview() const { return is_overview_; }
70 63
71 // Sets the size of a single workspace (all workspaces have the same size). 64 // Sets the size of a single workspace (all workspaces have the same size).
72 void SetWorkspaceSize(const gfx::Size& workspace_size); 65 void SetWorkspaceSize(const gfx::Size& workspace_size);
73 66
74 // Returns the window the layout manager should allow the size to be set for. 67 // Returns the window the layout manager should allow the size to be set for.
75 // TODO: maybe this should be set on WorkspaceLayoutManager. 68 // TODO: maybe this should be set on WorkspaceLayoutManager.
76 aura::Window* ignored_window() { return ignored_window_; } 69 aura::Window* ignored_window() { return ignored_window_; }
77 70
78 // Sets whether newly added windows open maximized. This is only applicable if
79 // the size of the root window is less than kOpenMaximizedThreshold. Default
80 // is true.
81 void set_open_new_windows_maximized(bool value) {
82 open_new_windows_maximized_ = value;
83 }
84 bool open_new_windows_maximized() const {
85 return open_new_windows_maximized_;
86 }
87
88 // Sets the size of the grid. Newly added windows are forced to align to the 71 // Sets the size of the grid. Newly added windows are forced to align to the
89 // size of the grid. 72 // size of the grid.
90 void set_grid_size(int size) { grid_size_ = size; } 73 void set_grid_size(int size) { grid_size_ = size; }
91 int grid_size() const { return grid_size_; } 74 int grid_size() const { return grid_size_; }
92 75
93 // Returns a bounds aligned to the grid. Returns |bounds| if grid_size is 0. 76 // Returns a bounds aligned to the grid. Returns |bounds| if grid_size is 0.
94 gfx::Rect AlignBoundsToGrid(const gfx::Rect& bounds); 77 gfx::Rect AlignBoundsToGrid(const gfx::Rect& bounds);
95 78
96 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } 79 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; }
97 80
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 161
179 // True if the workspace manager is in overview mode. 162 // True if the workspace manager is in overview mode.
180 bool is_overview_; 163 bool is_overview_;
181 164
182 // The window that WorkspaceManager does not set the bounds on. 165 // The window that WorkspaceManager does not set the bounds on.
183 aura::Window* ignored_window_; 166 aura::Window* ignored_window_;
184 167
185 // See description above setter. 168 // See description above setter.
186 int grid_size_; 169 int grid_size_;
187 170
188 // See description above setter.
189 bool open_new_windows_maximized_;
190
191 // Owned by the Shell container window LauncherContainer. May be NULL. 171 // Owned by the Shell container window LauncherContainer. May be NULL.
192 ShelfLayoutManager* shelf_; 172 ShelfLayoutManager* shelf_;
193 173
194 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); 174 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
195 }; 175 };
196 176
197 } // namespace internal 177 } // namespace internal
198 } // namespace ash 178 } // namespace ash
199 179
200 #endif // ASH_WM_WORKSPACE_MANAGER_H_ 180 #endif // ASH_WM_WORKSPACE_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698