OLD | NEW |
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_WORKSPACE_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 namespace aura { | 22 namespace aura { |
23 class RootWindow; | 23 class RootWindow; |
24 class Window; | 24 class Window; |
25 } | 25 } |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
28 class Layer; | 28 class Layer; |
29 } | 29 } |
30 | 30 |
31 namespace ash { | 31 namespace ash { |
| 32 class ShelfLayoutManager; |
| 33 class WorkspaceLayoutManagerDelegate; |
| 34 |
32 namespace wm { | 35 namespace wm { |
33 class WindowState; | 36 class WindowState; |
34 class WMEvent; | 37 class WMEvent; |
35 } | 38 } |
36 | 39 |
37 namespace internal { | |
38 | |
39 class ShelfLayoutManager; | |
40 class WorkspaceLayoutManagerDelegate; | |
41 | |
42 // LayoutManager used on the window created for a workspace. | 40 // LayoutManager used on the window created for a workspace. |
43 class ASH_EXPORT WorkspaceLayoutManager | 41 class ASH_EXPORT WorkspaceLayoutManager |
44 : public aura::LayoutManager, | 42 : public aura::LayoutManager, |
45 public aura::WindowObserver, | 43 public aura::WindowObserver, |
46 public aura::client::ActivationChangeObserver, | 44 public aura::client::ActivationChangeObserver, |
47 public ShellObserver, | 45 public ShellObserver, |
48 public wm::WindowStateObserver { | 46 public wm::WindowStateObserver { |
49 public: | 47 public: |
50 explicit WorkspaceLayoutManager(aura::Window* window); | 48 explicit WorkspaceLayoutManager(aura::Window* window); |
51 virtual ~WorkspaceLayoutManager(); | 49 virtual ~WorkspaceLayoutManager(); |
52 | 50 |
53 void SetShelf(internal::ShelfLayoutManager* shelf); | 51 void SetShelf(ShelfLayoutManager* shelf); |
54 | 52 |
55 // A delegate which can be set to add a backdrop behind the top most visible | 53 // A delegate which can be set to add a backdrop behind the top most visible |
56 // window. With the call the ownership of the delegate will be transferred to | 54 // window. With the call the ownership of the delegate will be transferred to |
57 // the WorkspaceLayoutManager. | 55 // the WorkspaceLayoutManager. |
58 void SetMaximizeBackdropDelegate( | 56 void SetMaximizeBackdropDelegate( |
59 scoped_ptr<WorkspaceLayoutManagerDelegate> delegate); | 57 scoped_ptr<WorkspaceLayoutManagerDelegate> delegate); |
60 | 58 |
61 // Overridden from aura::LayoutManager: | 59 // Overridden from aura::LayoutManager: |
62 virtual void OnWindowResized() OVERRIDE {} | 60 virtual void OnWindowResized() OVERRIDE {} |
63 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 61 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 void UpdateBoundsFromStateType(wm::WindowState* window_state, | 114 void UpdateBoundsFromStateType(wm::WindowState* window_state, |
117 wm::WindowStateType old_state_type); | 115 wm::WindowStateType old_state_type); |
118 | 116 |
119 // If |window_state| is maximized or fullscreen the bounds of the | 117 // If |window_state| is maximized or fullscreen the bounds of the |
120 // window are set and true is returned. Does nothing otherwise. | 118 // window are set and true is returned. Does nothing otherwise. |
121 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); | 119 bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state); |
122 | 120 |
123 // Animates the window bounds to |bounds|. | 121 // Animates the window bounds to |bounds|. |
124 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); | 122 void SetChildBoundsAnimated(aura::Window* child, const gfx::Rect& bounds); |
125 | 123 |
126 internal::ShelfLayoutManager* shelf_; | 124 ShelfLayoutManager* shelf_; |
127 aura::Window* window_; | 125 aura::Window* window_; |
128 aura::Window* root_window_; | 126 aura::Window* root_window_; |
129 | 127 |
130 // Set of windows we're listening to. | 128 // Set of windows we're listening to. |
131 WindowSet windows_; | 129 WindowSet windows_; |
132 | 130 |
133 // The work area in the coordinates of |window_|. | 131 // The work area in the coordinates of |window_|. |
134 gfx::Rect work_area_in_parent_; | 132 gfx::Rect work_area_in_parent_; |
135 | 133 |
136 // True if this workspace is currently in fullscreen mode. | 134 // True if this workspace is currently in fullscreen mode. |
137 bool is_fullscreen_; | 135 bool is_fullscreen_; |
138 | 136 |
139 // A window which covers the full container and which gets inserted behind the | 137 // A window which covers the full container and which gets inserted behind the |
140 // topmost visible window. | 138 // topmost visible window. |
141 scoped_ptr<WorkspaceLayoutManagerDelegate> backdrop_delegate_; | 139 scoped_ptr<WorkspaceLayoutManagerDelegate> backdrop_delegate_; |
142 | 140 |
143 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); | 141 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); |
144 }; | 142 }; |
145 | 143 |
146 } // namespace internal | |
147 } // namespace ash | 144 } // namespace ash |
148 | 145 |
149 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 146 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
OLD | NEW |