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

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

Issue 10852003: Changes all non-workspace code to talk to WorkspaceManager via (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more constness Created 8 years, 4 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_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"
11 #include "ash/wm/workspace/workspace.h" 11 #include "ash/wm/workspace/workspace.h"
12 #include "ash/wm/workspace/workspace_types.h"
12 #include "base/basictypes.h" 13 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "ui/gfx/insets.h" 15 #include "ui/gfx/insets.h"
15 #include "ui/gfx/size.h" 16 #include "ui/gfx/size.h"
16 17
17 namespace aura { 18 namespace aura {
18 class Window; 19 class Window;
19 } 20 }
20 21
21 namespace gfx { 22 namespace gfx {
22 class Point; 23 class Point;
23 class Rect; 24 class Rect;
24 } 25 }
25 26
26 namespace ash { 27 namespace ash {
27 namespace internal { 28 namespace internal {
28 29
29 class ShelfLayoutManager; 30 class ShelfLayoutManager;
30 class WorkspaceManagerTest; 31 class WorkspaceManagerTest;
31 32
32 // WorkspaceManager manages multiple workspaces in the desktop. 33 // WorkspaceManager manages multiple workspaces in the desktop.
33 class ASH_EXPORT WorkspaceManager { 34 class ASH_EXPORT WorkspaceManager {
34 public: 35 public:
35 enum WindowState {
36 // There's a full screen window.
37 WINDOW_STATE_FULL_SCREEN,
38
39 // There's a maximized window.
40 WINDOW_STATE_MAXIMIZED,
41
42 // At least one window overlaps the shelf.
43 WINDOW_STATE_WINDOW_OVERLAPS_SHELF,
44
45 // None of the windows are fullscreen, maximized or touch the shelf.
46 WINDOW_STATE_DEFAULT,
47 };
48
49 explicit WorkspaceManager(aura::Window* viewport); 36 explicit WorkspaceManager(aura::Window* viewport);
50 virtual ~WorkspaceManager(); 37 virtual ~WorkspaceManager();
51 38
52 // Returns true if |window| should be managed by the WorkspaceManager. Use 39 // Returns true if |window| should be managed by the WorkspaceManager. Use
53 // Contains() to test if the Window is currently managed by WorkspaceManager. 40 // Contains() to test if the Window is currently managed by WorkspaceManager.
54 static bool ShouldManageWindow(aura::Window* window); 41 static bool ShouldManageWindow(aura::Window* window);
55 42
56 // Returns true if |window| has been added to this WorkspaceManager. 43 // Returns true if |window| has been added to this WorkspaceManager.
57 bool Contains(aura::Window* window) const; 44 bool Contains(aura::Window* window) const;
58 45
(...skipping 22 matching lines...) Expand all
81 // size of the grid. 68 // size of the grid.
82 void set_grid_size(int size) { grid_size_ = size; } 69 void set_grid_size(int size) { grid_size_ = size; }
83 int grid_size() const { return grid_size_; } 70 int grid_size() const { return grid_size_; }
84 71
85 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; } 72 void set_shelf(ShelfLayoutManager* shelf) { shelf_ = shelf; }
86 73
87 // Updates the visibility and whether any windows overlap the shelf. 74 // Updates the visibility and whether any windows overlap the shelf.
88 void UpdateShelfVisibility(); 75 void UpdateShelfVisibility();
89 76
90 // Returns the current window state. 77 // Returns the current window state.
91 WindowState GetWindowState(); 78 WorkspaceWindowState GetWindowState() const;
92 79
93 // Invoked when the show state of the specified window changes. 80 // Invoked when the show state of the specified window changes.
94 void ShowStateChanged(aura::Window* window); 81 void ShowStateChanged(aura::Window* window);
95 82
96 private: 83 private:
97 // Enumeration of whether windows should animate or not. 84 // Enumeration of whether windows should animate or not.
98 enum AnimateChangeType { 85 enum AnimateChangeType {
99 ANIMATE, 86 ANIMATE,
100 DONT_ANIMATE 87 DONT_ANIMATE
101 }; 88 };
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // Owned by the Shell container window LauncherContainer. May be NULL. 151 // Owned by the Shell container window LauncherContainer. May be NULL.
165 ShelfLayoutManager* shelf_; 152 ShelfLayoutManager* shelf_;
166 153
167 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager); 154 DISALLOW_COPY_AND_ASSIGN(WorkspaceManager);
168 }; 155 };
169 156
170 } // namespace internal 157 } // namespace internal
171 } // namespace ash 158 } // namespace ash
172 159
173 #endif // ASH_WM_WORKSPACE_MANAGER_H_ 160 #endif // ASH_WM_WORKSPACE_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_event_filter_unittest.cc ('k') | ash/wm/workspace/workspace_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698