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

Side by Side Diff: ash/root_window_controller.h

Issue 11093050: Move shelf/launcher/status_area_widget/panel_layout_manager to RootWindowController (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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
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/wm/shelf_types.h"
9 #include "base/basictypes.h" 10 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
11 12
12 class SkBitmap; 13 class SkBitmap;
13 14
14 namespace aura { 15 namespace aura {
15 class EventFilter; 16 class EventFilter;
16 class RootWindow; 17 class RootWindow;
17 class Window; 18 class Window;
18 namespace shared { 19 namespace shared {
19 class InputMethodEventFilter; 20 class InputMethodEventFilter;
20 class RootWindowEventFilter; 21 class RootWindowEventFilter;
21 } // namespace shared 22 } // namespace shared
22 } // namespace aura 23 } // namespace aura
23 24
24 namespace ash { 25 namespace ash {
26 class Launcher;
25 class ToplevelWindowEventHandler; 27 class ToplevelWindowEventHandler;
28
26 namespace internal { 29 namespace internal {
27 30
28 class EventClientImpl; 31 class EventClientImpl;
32 class PanelLayoutManager;
29 class RootWindowLayoutManager; 33 class RootWindowLayoutManager;
30 class ScreenDimmer; 34 class ScreenDimmer;
35 class ShelfLayoutManager;
36 class StatusAreaWidget;
31 class SystemBackgroundController; 37 class SystemBackgroundController;
32 class SystemModalContainerLayoutManager; 38 class SystemModalContainerLayoutManager;
33 class WorkspaceController; 39 class WorkspaceController;
34 40
35 // This class maintains the per root window state for ash. This class 41 // This class maintains the per root window state for ash. This class
36 // owns the root window and other dependent objects that should be 42 // owns the root window and other dependent objects that should be
37 // deleted upon the deletion of the root window. The RootWindowController 43 // deleted upon the deletion of the root window. The RootWindowController
38 // for particular root window is stored as a property and can be obtained 44 // for particular root window is stored as a property and can be obtained
39 // using |GetRootWindowController(aura::RootWindow*)| function. 45 // using |GetRootWindowController(aura::RootWindow*)| function.
40 class ASH_EXPORT RootWindowController { 46 class ASH_EXPORT RootWindowController {
41 public: 47 public:
42 explicit RootWindowController(aura::RootWindow* root_window); 48 explicit RootWindowController(aura::RootWindow* root_window);
43 ~RootWindowController(); 49 ~RootWindowController();
44 50
45 aura::RootWindow* root_window() { 51 aura::RootWindow* root_window() { return root_window_.get(); }
46 return root_window_.get();
47 }
48 52
49 RootWindowLayoutManager* root_window_layout() { 53 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; }
50 return root_window_layout_;
51 }
52 54
53 WorkspaceController* workspace_controller() { 55 WorkspaceController* workspace_controller() {
54 return workspace_controller_.get(); 56 return workspace_controller_.get();
55 } 57 }
56 58
57 ScreenDimmer* screen_dimmer() { 59 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); }
58 return screen_dimmer_.get(); 60
61 Launcher* launcher() { return launcher_.get(); }
62
63 // TODO(sky): don't expose this!
64 internal::ShelfLayoutManager* shelf() const { return shelf_; }
65
66 internal::StatusAreaWidget* status_area_widget() const {
67 return status_area_widget_;
59 } 68 }
60 69
61 SystemModalContainerLayoutManager* GetSystemModalLayoutManager(); 70 SystemModalContainerLayoutManager* GetSystemModalLayoutManager();
62 71
63 aura::Window* GetContainer(int container_id); 72 aura::Window* GetContainer(int container_id);
64 73
65 void InitLayoutManagers(); 74 void InitLayoutManagers();
66 void CreateContainers(); 75 void CreateContainers();
67 76
77 // Initializs the RootWindowController for primary display. This
78 // creates
79 void InitForPrimaryDisplay();
80
68 // Initializes |background_|. |is_first_run_after_boot| determines the 81 // Initializes |background_|. |is_first_run_after_boot| determines the
69 // background's initial color. 82 // background's initial color.
70 void CreateSystemBackground(bool is_first_run_after_boot); 83 void CreateSystemBackground(bool is_first_run_after_boot);
71 84
85 // Initializes |launcher_|. Does nothing if it's already initialized.
86 void CreateLauncher();
87
88 // Show launcher view if it was created hidden (before session has started).
89 void ShowLauncher();
90
72 // Updates |background_| to be black after the desktop background is visible. 91 // Updates |background_| to be black after the desktop background is visible.
73 void HandleDesktopBackgroundVisible(); 92 void HandleDesktopBackgroundVisible();
74 93
75 // Deletes associated objects and clears the state, but doesn't delete 94 // Deletes associated objects and clears the state, but doesn't delete
76 // the root window yet. This is used to delete a secondary displays' 95 // the root window yet. This is used to delete a secondary displays'
77 // root window safely when the display disconnect signal is received, 96 // root window safely when the display disconnect signal is received,
78 // which may come while we're in the nested message loop. 97 // which may come while we're in the nested message loop.
79 void Shutdown(); 98 void Shutdown();
80 99
81 // Deletes all child windows and performs necessary cleanup. 100 // Deletes all child windows and performs necessary cleanup.
82 void CloseChildWindows(); 101 void CloseChildWindows();
83 102
84 // Returns true if the workspace has a maximized or fullscreen window. 103 // Returns true if the workspace has a maximized or fullscreen window.
85 bool IsInMaximizedMode() const; 104 bool IsInMaximizedMode() const;
86 105
87 // Moves child windows to |dest|. 106 // Moves child windows to |dest|.
88 void MoveWindowsTo(aura::RootWindow* dest); 107 void MoveWindowsTo(aura::RootWindow* dest);
89 108
90 private: 109 // Force the shelf to query for it's current visibility state.
110 void UpdateShelfVisibility();
111
112 // Sets/gets the shelf auto-hide behavior.
113 void SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior);
114 ShelfAutoHideBehavior GetShelfAutoHideBehavior() const;
115
116 // Sets/gets the shelf alignemnt.
117 bool SetShelfAlignment(ShelfAlignment alignment);
118 ShelfAlignment GetShelfAlignment();
119
120 private:
91 // Creates each of the special window containers that holds windows of various 121 // Creates each of the special window containers that holds windows of various
92 // types in the shell UI. 122 // types in the shell UI.
93 void CreateContainersInRootWindow(aura::RootWindow* root_window); 123 void CreateContainersInRootWindow(aura::RootWindow* root_window);
94 124
95 scoped_ptr<aura::RootWindow> root_window_; 125 scoped_ptr<aura::RootWindow> root_window_;
96 RootWindowLayoutManager* root_window_layout_; 126 RootWindowLayoutManager* root_window_layout_;
97 127
128 // Widget containing system tray.
129 internal::StatusAreaWidget* status_area_widget_;
130
131 // The shelf for managing the launcher and the status widget.
132 // RootWindowController does not own the shelf. Instead, it is owned
133 // by container of the status area.
134 internal::ShelfLayoutManager* shelf_;
135
136 // Manages layout of panels. Owned by PanelContainer.
137 internal::PanelLayoutManager* panel_layout_manager_;
138
139 scoped_ptr<Launcher> launcher_;
140
98 // A background layer that's displayed beneath all other layers. Without 141 // A background layer that's displayed beneath all other layers. Without
99 // this, portions of the root window that aren't covered by layers will be 142 // this, portions of the root window that aren't covered by layers will be
100 // painted white; this can show up if e.g. it takes a long time to decode the 143 // painted white; this can show up if e.g. it takes a long time to decode the
101 // desktop background image when displaying the login screen. 144 // desktop background image when displaying the login screen.
102 scoped_ptr<SystemBackgroundController> background_; 145 scoped_ptr<SystemBackgroundController> background_;
103 146
104 // An event filter that pre-handles all key events to send them to an IME. 147 // An event filter that pre-handles all key events to send them to an IME.
105 scoped_ptr<EventClientImpl> event_client_; 148 scoped_ptr<EventClientImpl> event_client_;
106 scoped_ptr<ScreenDimmer> screen_dimmer_; 149 scoped_ptr<ScreenDimmer> screen_dimmer_;
107 scoped_ptr<WorkspaceController> workspace_controller_; 150 scoped_ptr<WorkspaceController> workspace_controller_;
108 151
109 // We need to own event handlers for various containers. 152 // We need to own event handlers for various containers.
110 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; 153 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_;
111 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; 154 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_;
112 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; 155 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_;
113 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; 156 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_;
114 157
115 DISALLOW_COPY_AND_ASSIGN(RootWindowController); 158 DISALLOW_COPY_AND_ASSIGN(RootWindowController);
116 }; 159 };
117 160
118 } // namespace internal 161 } // namespace internal
119 } // ash 162 } // ash
120 163
121 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ 164 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ash/display/display_controller.cc ('k') | ash/root_window_controller.cc » ('j') | ash/shell.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698