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

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

Issue 10827377: Adds an interface between WorkspaceController and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add virtual & OVERRIDE 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_manager.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"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "ui/aura/client/activation_change_observer.h" 12 #include "ui/aura/client/activation_change_observer.h"
13 13
14 namespace aura { 14 namespace aura {
15 class Window; 15 class Window;
16 } 16 }
17 17
18 namespace ash { 18 namespace ash {
19 namespace internal { 19 namespace internal {
20 20
21 class BaseWorkspaceManager;
21 class ShelfLayoutManager; 22 class ShelfLayoutManager;
22 class WorkspaceControllerTestHelper; 23 class WorkspaceControllerTestHelper;
23 class WorkspaceEventFilter; 24 class WorkspaceEventFilter;
24 class WorkspaceLayoutManager; 25 class WorkspaceLayoutManager;
25 class WorkspaceManager;
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 in maximized or fullscreen mode. 36 // Returns true if in maximized or fullscreen mode.
37 bool IsInMaximizedMode() const; 37 bool IsInMaximizedMode() const;
38 38
39 // Sets the size of the grid. 39 // Sets the size of the grid.
40 void SetGridSize(int grid_size); 40 void SetGridSize(int grid_size);
41 int GetGridSize() const; 41 int GetGridSize() const;
42 42
43 // Returns the current window state. 43 // Returns the current window state.
44 WorkspaceWindowState GetWindowState() const; 44 WorkspaceWindowState GetWindowState() const;
45 45
46 void SetShelf(ShelfLayoutManager* shelf); 46 void SetShelf(ShelfLayoutManager* shelf);
47 47
48 // Sets the active workspace based on |window|.
49 void SetActiveWorkspaceByWindow(aura::Window* window);
50
51 // See description in BaseWorkspaceManager::GetParentForNewWindow().
52 aura::Window* GetParentForNewWindow(aura::Window* window);
53
48 // aura::client::ActivationChangeObserver overrides: 54 // aura::client::ActivationChangeObserver overrides:
49 virtual void OnWindowActivated(aura::Window* window, 55 virtual void OnWindowActivated(aura::Window* window,
50 aura::Window* old_active) OVERRIDE; 56 aura::Window* old_active) OVERRIDE;
51 57
52 private: 58 private:
53 friend class WorkspaceControllerTestHelper; 59 friend class WorkspaceControllerTestHelper;
54 60
55 aura::Window* viewport_; 61 aura::Window* viewport_;
56 62
57 scoped_ptr<WorkspaceManager> workspace_manager_; 63 scoped_ptr<BaseWorkspaceManager> workspace_manager_;
58 64
59 // Owned by the window its attached to. 65 // Owned by the window its attached to.
60 WorkspaceLayoutManager* layout_manager_; 66 WorkspaceLayoutManager* layout_manager_;
61 67
62 // Owned by |viewport_|. 68 // Owned by |viewport_|.
63 WorkspaceEventFilter* event_filter_; 69 WorkspaceEventFilter* event_filter_;
64 70
65 DISALLOW_COPY_AND_ASSIGN(WorkspaceController); 71 DISALLOW_COPY_AND_ASSIGN(WorkspaceController);
66 }; 72 };
67 73
68 } // namespace internal 74 } // namespace internal
69 } // namespace ash 75 } // namespace ash
70 76
71 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_ 77 #endif // ASH_WM_WORKSPACE_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_manager.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698