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" |
11 #include "ash/shell_observer.h" | 11 #include "ash/shell_observer.h" |
12 #include "ash/wm/window_state_observer.h" | 12 #include "ash/wm/window_state_observer.h" |
13 #include "ash/wm/wm_types.h" | 13 #include "ash/wm/wm_types.h" |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" |
16 #include "ui/aura/client/activation_change_observer.h" | 17 #include "ui/aura/client/activation_change_observer.h" |
17 #include "ui/aura/layout_manager.h" | 18 #include "ui/aura/layout_manager.h" |
18 #include "ui/aura/window_observer.h" | 19 #include "ui/aura/window_observer.h" |
19 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
20 | 21 |
21 namespace aura { | 22 namespace aura { |
22 class RootWindow; | 23 class RootWindow; |
23 class Window; | 24 class Window; |
24 } | 25 } |
25 | 26 |
26 namespace ui { | 27 namespace ui { |
27 class Layer; | 28 class Layer; |
28 } | 29 } |
29 | 30 |
30 namespace ash { | 31 namespace ash { |
31 namespace wm { | 32 namespace wm { |
32 class WindowState; | 33 class WindowState; |
33 class WMEvent; | 34 class WMEvent; |
34 } | 35 } |
35 | 36 |
36 namespace internal { | 37 namespace internal { |
37 | 38 |
38 class ShelfLayoutManager; | 39 class ShelfLayoutManager; |
| 40 class WorkspaceLayoutManagerDelegate; |
39 | 41 |
40 // LayoutManager used on the window created for a workspace. | 42 // LayoutManager used on the window created for a workspace. |
41 class ASH_EXPORT WorkspaceLayoutManager | 43 class ASH_EXPORT WorkspaceLayoutManager |
42 : public aura::LayoutManager, | 44 : public aura::LayoutManager, |
43 public aura::WindowObserver, | 45 public aura::WindowObserver, |
44 public aura::client::ActivationChangeObserver, | 46 public aura::client::ActivationChangeObserver, |
45 public ShellObserver, | 47 public ShellObserver, |
46 public wm::WindowStateObserver { | 48 public wm::WindowStateObserver { |
47 public: | 49 public: |
48 explicit WorkspaceLayoutManager(aura::Window* window); | 50 explicit WorkspaceLayoutManager(aura::Window* window); |
49 virtual ~WorkspaceLayoutManager(); | 51 virtual ~WorkspaceLayoutManager(); |
50 | 52 |
51 void SetShelf(internal::ShelfLayoutManager* shelf); | 53 void SetShelf(internal::ShelfLayoutManager* shelf); |
52 | 54 |
| 55 // 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 |
| 57 // the WorkspaceLayoutManager. |
| 58 void SetMaximizeBackdropDelegate( |
| 59 scoped_ptr<WorkspaceLayoutManagerDelegate> delegate); |
| 60 |
53 // Overridden from aura::LayoutManager: | 61 // Overridden from aura::LayoutManager: |
54 virtual void OnWindowResized() OVERRIDE {} | 62 virtual void OnWindowResized() OVERRIDE {} |
55 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | 63 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; |
56 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | 64 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; |
57 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; | 65 virtual void OnWindowRemovedFromLayout(aura::Window* child) OVERRIDE; |
58 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | 66 virtual void OnChildWindowVisibilityChanged(aura::Window* child, |
59 bool visibile) OVERRIDE; | 67 bool visibile) OVERRIDE; |
60 virtual void SetChildBounds(aura::Window* child, | 68 virtual void SetChildBounds(aura::Window* child, |
61 const gfx::Rect& requested_bounds) OVERRIDE; | 69 const gfx::Rect& requested_bounds) OVERRIDE; |
62 | 70 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 129 |
122 // Set of windows we're listening to. | 130 // Set of windows we're listening to. |
123 WindowSet windows_; | 131 WindowSet windows_; |
124 | 132 |
125 // The work area in the coordinates of |window_|. | 133 // The work area in the coordinates of |window_|. |
126 gfx::Rect work_area_in_parent_; | 134 gfx::Rect work_area_in_parent_; |
127 | 135 |
128 // True if this workspace is currently in fullscreen mode. | 136 // True if this workspace is currently in fullscreen mode. |
129 bool is_fullscreen_; | 137 bool is_fullscreen_; |
130 | 138 |
| 139 // A window which covers the full container and which gets inserted behind the |
| 140 // topmost visible window. |
| 141 scoped_ptr<WorkspaceLayoutManagerDelegate> backdrop_delegate_; |
| 142 |
131 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); | 143 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); |
132 }; | 144 }; |
133 | 145 |
134 } // namespace internal | 146 } // namespace internal |
135 } // namespace ash | 147 } // namespace ash |
136 | 148 |
137 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 149 #endif // ASH_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
OLD | NEW |