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_ROOT_WINDOW_CONTROLLER_H_ | 5 #ifndef ASH_ROOT_WINDOW_CONTROLLER_H_ |
6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ | 6 #define ASH_ROOT_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shelf_types.h" | 9 #include "ash/shelf/shelf_types.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 | 13 |
14 class SkBitmap; | 14 class SkBitmap; |
15 | 15 |
16 namespace aura { | 16 namespace aura { |
17 class EventFilter; | 17 class EventFilter; |
18 class RootWindow; | 18 class RootWindow; |
19 class Window; | 19 class Window; |
20 } | 20 } |
21 | 21 |
22 namespace gfx { | 22 namespace gfx { |
23 class Point; | 23 class Point; |
24 } | 24 } |
25 | 25 |
26 namespace views { | 26 namespace views { |
27 namespace corewm { | 27 namespace corewm { |
28 class InputMethodEventFilter; | 28 class InputMethodEventFilter; |
29 class RootWindowEventFilter; | 29 class RootWindowEventFilter; |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 namespace ash { | 33 namespace ash { |
34 class Launcher; | |
35 class StackingController; | 34 class StackingController; |
35 class ShelfWidget; | |
36 class SystemTray; | 36 class SystemTray; |
37 class ToplevelWindowEventHandler; | 37 class ToplevelWindowEventHandler; |
38 | 38 |
39 namespace internal { | 39 namespace internal { |
40 | 40 |
41 class BootSplashScreen; | 41 class BootSplashScreen; |
42 class PanelLayoutManager; | 42 class PanelLayoutManager; |
43 class RootWindowLayoutManager; | 43 class RootWindowLayoutManager; |
44 class ScreenDimmer; | 44 class ScreenDimmer; |
45 class ShelfLayoutManager; | 45 class ShelfLayoutManager; |
(...skipping 27 matching lines...) Expand all Loading... | |
73 aura::RootWindow* root_window() { return root_window_.get(); } | 73 aura::RootWindow* root_window() { return root_window_.get(); } |
74 | 74 |
75 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } | 75 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } |
76 | 76 |
77 WorkspaceController* workspace_controller() { | 77 WorkspaceController* workspace_controller() { |
78 return workspace_controller_.get(); | 78 return workspace_controller_.get(); |
79 } | 79 } |
80 | 80 |
81 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } | 81 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } |
82 | 82 |
83 Launcher* launcher() { return launcher_.get(); } | 83 // Access the shelf associated with this root window controller, |
84 // NULL if no such shelf exists. | |
85 ShelfWidget* shelf() const { return shelf_.get(); } | |
James Cook
2013/03/05 20:30:38
no const
Harry McCleave
2013/03/06 01:59:49
Done.
| |
84 | 86 |
85 ShelfLayoutManager* shelf() const { return shelf_; } | 87 // Access the shelf layout manager associated with this root |
86 | 88 // window controller, NULL if no such shelf exists. |
87 StatusAreaWidget* status_area_widget() { | 89 ShelfLayoutManager* shelf_layout_manager() const; |
James Cook
2013/03/05 20:30:38
inline or GetShelfLayoutManager
Harry McCleave
2013/03/06 01:59:49
Done.
| |
88 return status_area_widget_; | |
89 } | |
90 | 90 |
91 // Returns the system tray on this root window. Note that | 91 // Returns the system tray on this root window. Note that |
92 // calling this on the root window that doesn't have a launcher will | 92 // calling this on the root window that doesn't have a launcher will |
93 // lead to a crash. | 93 // lead to a crash. |
94 SystemTray* GetSystemTray(); | 94 SystemTray* GetSystemTray(); |
95 | 95 |
96 // Shows context menu at the |location_in_screen|. This uses | 96 // Shows context menu at the |location_in_screen|. This uses |
97 // |ShellDelegate::CreateContextMenu| to define the content of the menu. | 97 // |ShellDelegate::CreateContextMenu| to define the content of the menu. |
98 void ShowContextMenu(const gfx::Point& location_in_screen); | 98 void ShowContextMenu(const gfx::Point& location_in_screen); |
99 | 99 |
(...skipping 13 matching lines...) Expand all Loading... | |
113 void CreateContainers(); | 113 void CreateContainers(); |
114 | 114 |
115 // Initializs the RootWindowController for primary display. This | 115 // Initializs the RootWindowController for primary display. This |
116 // creates | 116 // creates |
117 void InitForPrimaryDisplay(); | 117 void InitForPrimaryDisplay(); |
118 | 118 |
119 // Initializes |system_background_| and possibly also |boot_splash_screen_|. | 119 // Initializes |system_background_| and possibly also |boot_splash_screen_|. |
120 // |is_first_run_after_boot| determines the background's initial color. | 120 // |is_first_run_after_boot| determines the background's initial color. |
121 void CreateSystemBackground(bool is_first_run_after_boot); | 121 void CreateSystemBackground(bool is_first_run_after_boot); |
122 | 122 |
123 // Initializes |launcher_|. Does nothing if it's already initialized. | |
124 void CreateLauncher(); | |
125 | |
126 // Show launcher view if it was created hidden (before session has started). | 123 // Show launcher view if it was created hidden (before session has started). |
127 void ShowLauncher(); | 124 void ShowLauncher(); |
128 | 125 |
126 // Called when the launcher associated with this root window is created. | |
127 void OnLauncherCreated(); | |
128 | |
129 // Called when the user logs in. | 129 // Called when the user logs in. |
130 void OnLoginStateChanged(user::LoginStatus status); | 130 void OnLoginStateChanged(user::LoginStatus status); |
131 | 131 |
132 // Called when the login status changes after login (such as lock/unlock). | 132 // Called when the login status changes after login (such as lock/unlock). |
133 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. | 133 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. |
134 void UpdateAfterLoginStatusChange(user::LoginStatus status); | 134 void UpdateAfterLoginStatusChange(user::LoginStatus status); |
135 | 135 |
136 // Called when the brightness/grayscale animation from white to the login | 136 // Called when the brightness/grayscale animation from white to the login |
137 // desktop background image has started. Starts |boot_splash_screen_|'s | 137 // desktop background image has started. Starts |boot_splash_screen_|'s |
138 // hiding animation (if the screen is non-NULL). | 138 // hiding animation (if the screen is non-NULL). |
(...skipping 11 matching lines...) Expand all Loading... | |
150 | 150 |
151 // Deletes all child windows and performs necessary cleanup. | 151 // Deletes all child windows and performs necessary cleanup. |
152 void CloseChildWindows(); | 152 void CloseChildWindows(); |
153 | 153 |
154 // Moves child windows to |dest|. | 154 // Moves child windows to |dest|. |
155 void MoveWindowsTo(aura::RootWindow* dest); | 155 void MoveWindowsTo(aura::RootWindow* dest); |
156 | 156 |
157 // Force the shelf to query for it's current visibility state. | 157 // Force the shelf to query for it's current visibility state. |
158 void UpdateShelfVisibility(); | 158 void UpdateShelfVisibility(); |
159 | 159 |
160 // Sets/gets the shelf auto-hide behavior. | |
161 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior); | |
162 ShelfAutoHideBehavior GetShelfAutoHideBehavior() const; | |
163 | |
164 // Sets/gets the shelf alignemnt. | |
165 bool SetShelfAlignment(ShelfAlignment alignment); | |
166 ShelfAlignment GetShelfAlignment(); | |
167 | |
168 // Returns true if the active workspace is in immersive mode. Exposed here | 160 // Returns true if the active workspace is in immersive mode. Exposed here |
169 // so clients of Ash don't need to know the details of workspace management. | 161 // so clients of Ash don't need to know the details of workspace management. |
170 bool IsImmersiveMode() const; | 162 bool IsImmersiveMode() const; |
171 | 163 |
172 private: | 164 private: |
173 // Creates each of the special window containers that holds windows of various | 165 // Creates each of the special window containers that holds windows of various |
174 // types in the shell UI. | 166 // types in the shell UI. |
175 void CreateContainersInRootWindow(aura::RootWindow* root_window); | 167 void CreateContainersInRootWindow(aura::RootWindow* root_window); |
176 | 168 |
177 scoped_ptr<aura::RootWindow> root_window_; | 169 scoped_ptr<aura::RootWindow> root_window_; |
178 RootWindowLayoutManager* root_window_layout_; | 170 RootWindowLayoutManager* root_window_layout_; |
179 | 171 |
180 scoped_ptr<StackingController> stacking_controller_; | 172 scoped_ptr<StackingController> stacking_controller_; |
181 | 173 |
182 // Widget containing system tray. | |
183 StatusAreaWidget* status_area_widget_; | |
184 | |
185 // The shelf for managing the launcher and the status widget. | 174 // The shelf for managing the launcher and the status widget. |
186 // RootWindowController does not own the shelf. Instead, it is owned | 175 // RootWindowController does not own the shelf. Instead, it is owned |
187 // by container of the status area. | 176 // by container of the status area. |
188 ShelfLayoutManager* shelf_; | 177 scoped_ptr<ShelfWidget> shelf_; |
189 | 178 |
190 // Manages layout of panels. Owned by PanelContainer. | 179 // Manages layout of panels. Owned by PanelContainer. |
191 PanelLayoutManager* panel_layout_manager_; | 180 PanelLayoutManager* panel_layout_manager_; |
192 | 181 |
193 scoped_ptr<Launcher> launcher_; | |
194 | |
195 scoped_ptr<SystemBackgroundController> system_background_; | 182 scoped_ptr<SystemBackgroundController> system_background_; |
196 scoped_ptr<BootSplashScreen> boot_splash_screen_; | 183 scoped_ptr<BootSplashScreen> boot_splash_screen_; |
197 | 184 |
198 scoped_ptr<ScreenDimmer> screen_dimmer_; | 185 scoped_ptr<ScreenDimmer> screen_dimmer_; |
199 scoped_ptr<WorkspaceController> workspace_controller_; | 186 scoped_ptr<WorkspaceController> workspace_controller_; |
200 | 187 |
201 // We need to own event handlers for various containers. | 188 // We need to own event handlers for various containers. |
202 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; | 189 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; |
203 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; | 190 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; |
204 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; | 191 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; |
205 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; | 192 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; |
206 scoped_ptr<ToplevelWindowEventHandler> panel_container_handler_; | 193 scoped_ptr<ToplevelWindowEventHandler> panel_container_handler_; |
207 | 194 |
208 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 195 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
209 }; | 196 }; |
210 | 197 |
211 } // namespace internal | 198 } // namespace internal |
212 } // ash | 199 } // ash |
213 | 200 |
214 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 201 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |