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

Side by Side Diff: ash/root_window_controller.h

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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
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_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
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 ShelfWidget* shelf() const { return shelf_.get(); }
Mr4D (OOO till 08-26) 2013/03/04 19:18:04 Please add a short comment.
Harry McCleave 2013/03/04 20:29:24 Done.
84 84 ShelfLayoutManager* shelf_layout_manager() const;
Mr4D (OOO till 08-26) 2013/03/04 19:18:04 Here as well. Note that the function might return
Harry McCleave 2013/03/04 20:29:24 Done.
85 ShelfLayoutManager* shelf() const { return shelf_; }
86
87 StatusAreaWidget* status_area_widget() {
88 return status_area_widget_;
89 }
90 85
91 // Returns the system tray on this root window. Note that 86 // Returns the system tray on this root window. Note that
92 // calling this on the root window that doesn't have a launcher will 87 // calling this on the root window that doesn't have a launcher will
93 // lead to a crash. 88 // lead to a crash.
94 SystemTray* GetSystemTray(); 89 SystemTray* GetSystemTray();
95 90
96 // Shows context menu at the |location_in_screen|. This uses 91 // Shows context menu at the |location_in_screen|. This uses
97 // |ShellDelegate::CreateContextMenu| to define the content of the menu. 92 // |ShellDelegate::CreateContextMenu| to define the content of the menu.
98 void ShowContextMenu(const gfx::Point& location_in_screen); 93 void ShowContextMenu(const gfx::Point& location_in_screen);
99 94
(...skipping 13 matching lines...) Expand all
113 void CreateContainers(); 108 void CreateContainers();
114 109
115 // Initializs the RootWindowController for primary display. This 110 // Initializs the RootWindowController for primary display. This
116 // creates 111 // creates
117 void InitForPrimaryDisplay(); 112 void InitForPrimaryDisplay();
118 113
119 // Initializes |system_background_| and possibly also |boot_splash_screen_|. 114 // Initializes |system_background_| and possibly also |boot_splash_screen_|.
120 // |is_first_run_after_boot| determines the background's initial color. 115 // |is_first_run_after_boot| determines the background's initial color.
121 void CreateSystemBackground(bool is_first_run_after_boot); 116 void CreateSystemBackground(bool is_first_run_after_boot);
122 117
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). 118 // Show launcher view if it was created hidden (before session has started).
127 void ShowLauncher(); 119 void ShowLauncher();
128 120
121 // Called when the launcher associated with this root window is created.
122 void OnLauncherCreated();
123
129 // Called when the user logs in. 124 // Called when the user logs in.
130 void OnLoginStateChanged(user::LoginStatus status); 125 void OnLoginStateChanged(user::LoginStatus status);
131 126
132 // Called when the login status changes after login (such as lock/unlock). 127 // Called when the login status changes after login (such as lock/unlock).
133 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|. 128 // TODO(oshima): Investigate if we can merge this and |OnLoginStateChanged|.
134 void UpdateAfterLoginStatusChange(user::LoginStatus status); 129 void UpdateAfterLoginStatusChange(user::LoginStatus status);
135 130
136 // Called when the brightness/grayscale animation from white to the login 131 // Called when the brightness/grayscale animation from white to the login
137 // desktop background image has started. Starts |boot_splash_screen_|'s 132 // desktop background image has started. Starts |boot_splash_screen_|'s
138 // hiding animation (if the screen is non-NULL). 133 // hiding animation (if the screen is non-NULL).
(...skipping 11 matching lines...) Expand all
150 145
151 // Deletes all child windows and performs necessary cleanup. 146 // Deletes all child windows and performs necessary cleanup.
152 void CloseChildWindows(); 147 void CloseChildWindows();
153 148
154 // Moves child windows to |dest|. 149 // Moves child windows to |dest|.
155 void MoveWindowsTo(aura::RootWindow* dest); 150 void MoveWindowsTo(aura::RootWindow* dest);
156 151
157 // Force the shelf to query for it's current visibility state. 152 // Force the shelf to query for it's current visibility state.
158 void UpdateShelfVisibility(); 153 void UpdateShelfVisibility();
159 154
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 155 // 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. 156 // so clients of Ash don't need to know the details of workspace management.
170 bool IsImmersiveMode() const; 157 bool IsImmersiveMode() const;
171 158
172 private: 159 private:
173 // Creates each of the special window containers that holds windows of various 160 // Creates each of the special window containers that holds windows of various
174 // types in the shell UI. 161 // types in the shell UI.
175 void CreateContainersInRootWindow(aura::RootWindow* root_window); 162 void CreateContainersInRootWindow(aura::RootWindow* root_window);
176 163
177 scoped_ptr<aura::RootWindow> root_window_; 164 scoped_ptr<aura::RootWindow> root_window_;
178 RootWindowLayoutManager* root_window_layout_; 165 RootWindowLayoutManager* root_window_layout_;
179 166
180 scoped_ptr<StackingController> stacking_controller_; 167 scoped_ptr<StackingController> stacking_controller_;
181 168
182 // Widget containing system tray.
183 StatusAreaWidget* status_area_widget_;
184
185 // The shelf for managing the launcher and the status widget. 169 // The shelf for managing the launcher and the status widget.
186 // RootWindowController does not own the shelf. Instead, it is owned 170 // RootWindowController does not own the shelf. Instead, it is owned
187 // by container of the status area. 171 // by container of the status area.
188 ShelfLayoutManager* shelf_; 172 scoped_ptr<ShelfWidget> shelf_;
189 173
190 // Manages layout of panels. Owned by PanelContainer. 174 // Manages layout of panels. Owned by PanelContainer.
191 PanelLayoutManager* panel_layout_manager_; 175 PanelLayoutManager* panel_layout_manager_;
192 176
193 scoped_ptr<Launcher> launcher_;
194
195 scoped_ptr<SystemBackgroundController> system_background_; 177 scoped_ptr<SystemBackgroundController> system_background_;
196 scoped_ptr<BootSplashScreen> boot_splash_screen_; 178 scoped_ptr<BootSplashScreen> boot_splash_screen_;
197 179
198 scoped_ptr<ScreenDimmer> screen_dimmer_; 180 scoped_ptr<ScreenDimmer> screen_dimmer_;
199 scoped_ptr<WorkspaceController> workspace_controller_; 181 scoped_ptr<WorkspaceController> workspace_controller_;
200 182
201 // We need to own event handlers for various containers. 183 // We need to own event handlers for various containers.
202 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; 184 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_;
203 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; 185 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_;
204 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; 186 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_;
205 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; 187 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_;
206 scoped_ptr<ToplevelWindowEventHandler> panel_container_handler_; 188 scoped_ptr<ToplevelWindowEventHandler> panel_container_handler_;
207 189
208 DISALLOW_COPY_AND_ASSIGN(RootWindowController); 190 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
209 }; 191 };
210 192
211 } // namespace internal 193 } // namespace internal
212 } // ash 194 } // ash
213 195
214 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ 196 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698