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

Side by Side Diff: ash/wm/workspace_controller.h

Issue 10830365: Initial crack at new workspace behavior. Each workspace now has its (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « ash/wm/workspace/workspace_manager2_unittest.cc ('k') | ash/wm/workspace_controller.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_CONTROLLER_H_ 5 #ifndef ASH_WM_WORKSPACE_CONTROLLER_H_
6 #define ASH_WM_WORKSPACE_CONTROLLER_H_ 6 #define ASH_WM_WORKSPACE_CONTROLLER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/workspace/workspace_types.h" 9 #include "ash/wm/workspace/workspace_types.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // WorkspaceController acts as a central place that ties together all the 27 // WorkspaceController acts as a central place that ties together all the
28 // various workspace pieces: WorkspaceManager, WorkspaceLayoutManager and 28 // various workspace pieces: WorkspaceManager, WorkspaceLayoutManager and
29 // WorkspaceEventFilter. 29 // WorkspaceEventFilter.
30 class ASH_EXPORT WorkspaceController 30 class ASH_EXPORT WorkspaceController
31 : public aura::client::ActivationChangeObserver { 31 : public aura::client::ActivationChangeObserver {
32 public: 32 public:
33 explicit WorkspaceController(aura::Window* viewport); 33 explicit WorkspaceController(aura::Window* viewport);
34 virtual ~WorkspaceController(); 34 virtual ~WorkspaceController();
35 35
36 // Returns true if Workspace2 is enabled.
37 static bool IsWorkspace2Enabled();
38
36 // Returns true if in maximized or fullscreen mode. 39 // Returns true if in maximized or fullscreen mode.
37 bool IsInMaximizedMode() const; 40 bool IsInMaximizedMode() const;
38 41
39 // Sets the size of the grid. 42 // Sets the size of the grid.
40 void SetGridSize(int grid_size); 43 void SetGridSize(int grid_size);
41 int GetGridSize() const; 44 int GetGridSize() const;
42 45
43 // Returns the current window state. 46 // Returns the current window state.
44 WorkspaceWindowState GetWindowState() const; 47 WorkspaceWindowState GetWindowState() const;
45 48
46 void SetShelf(ShelfLayoutManager* shelf); 49 void SetShelf(ShelfLayoutManager* shelf);
47 50
48 // Sets the active workspace based on |window|. 51 // Sets the active workspace based on |window|.
49 void SetActiveWorkspaceByWindow(aura::Window* window); 52 void SetActiveWorkspaceByWindow(aura::Window* window);
50 53
51 // See description in BaseWorkspaceManager::GetParentForNewWindow(). 54 // See description in BaseWorkspaceManager::GetParentForNewWindow().
52 aura::Window* GetParentForNewWindow(aura::Window* window); 55 aura::Window* GetParentForNewWindow(aura::Window* window);
53 56
54 // aura::client::ActivationChangeObserver overrides: 57 // aura::client::ActivationChangeObserver overrides:
55 virtual void OnWindowActivated(aura::Window* window, 58 virtual void OnWindowActivated(aura::Window* window,
56 aura::Window* old_active) OVERRIDE; 59 aura::Window* old_active) OVERRIDE;
57 60
58 private: 61 private:
59 friend class WorkspaceControllerTestHelper; 62 friend class WorkspaceControllerTestHelper;
60 63
61 aura::Window* viewport_; 64 aura::Window* viewport_;
62 65
63 scoped_ptr<BaseWorkspaceManager> workspace_manager_; 66 scoped_ptr<BaseWorkspaceManager> workspace_manager_;
64 67
68 // TODO(sky): remove |layout_manager_| and |event_filter_| when Workspace2
69 // is the default.
70
65 // Owned by the window its attached to. 71 // Owned by the window its attached to.
66 WorkspaceLayoutManager* layout_manager_; 72 WorkspaceLayoutManager* layout_manager_;
67 73
68 // Owned by |viewport_|. 74 // Owned by |viewport_|.
69 WorkspaceEventFilter* event_filter_; 75 WorkspaceEventFilter* event_filter_;
70 76
71 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); 77 DISALLOW_COPY_AND_ASSIGN(WorkspaceController);
72 }; 78 };
73 79
74 } // namespace internal 80 } // namespace internal
75 } // namespace ash 81 } // namespace ash
76 82
77 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ 83 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_manager2_unittest.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698