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/wm/shelf_types.h" | 9 #include "ash/wm/shelf_types.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // 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 |
42 // owns the root window and other dependent objects that should be | 42 // owns the root window and other dependent objects that should be |
43 // deleted upon the deletion of the root window. The RootWindowController | 43 // deleted upon the deletion of the root window. The RootWindowController |
44 // 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 |
45 // using |GetRootWindowController(aura::RootWindow*)| function. | 45 // using |GetRootWindowController(aura::RootWindow*)| function. |
46 class ASH_EXPORT RootWindowController { | 46 class ASH_EXPORT RootWindowController { |
47 public: | 47 public: |
48 explicit RootWindowController(aura::RootWindow* root_window); | 48 explicit RootWindowController(aura::RootWindow* root_window); |
49 ~RootWindowController(); | 49 ~RootWindowController(); |
50 | 50 |
| 51 // Returns a RootWindowController that has a launcher for given |
| 52 // |window|. This returns the RootWindowController for the |window|'s |
| 53 // root window when multiple launcher mode is enabled, or the primary |
| 54 // RootWindowController otherwise. |
| 55 static RootWindowController* ForLauncher(aura::Window* window); |
| 56 |
51 aura::RootWindow* root_window() { return root_window_.get(); } | 57 aura::RootWindow* root_window() { return root_window_.get(); } |
52 | 58 |
53 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } | 59 RootWindowLayoutManager* root_window_layout() { return root_window_layout_; } |
54 | 60 |
55 WorkspaceController* workspace_controller() { | 61 WorkspaceController* workspace_controller() { |
56 return workspace_controller_.get(); | 62 return workspace_controller_.get(); |
57 } | 63 } |
58 | 64 |
59 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } | 65 ScreenDimmer* screen_dimmer() { return screen_dimmer_.get(); } |
60 | 66 |
61 Launcher* launcher() { return launcher_.get(); } | 67 Launcher* launcher() { return launcher_.get(); } |
62 | 68 |
63 // TODO(sky): don't expose this! | 69 ShelfLayoutManager* shelf() const { return shelf_; } |
64 internal::ShelfLayoutManager* shelf() const { return shelf_; } | |
65 | 70 |
66 internal::StatusAreaWidget* status_area_widget() const { | 71 StatusAreaWidget* status_area_widget() const { |
67 return status_area_widget_; | 72 return status_area_widget_; |
68 } | 73 } |
69 | 74 |
70 // Returns the layout-manager for the appropriate modal-container. If the | 75 // Returns the layout-manager for the appropriate modal-container. If the |
71 // window is inside the lockscreen modal container, then the layout manager | 76 // window is inside the lockscreen modal container, then the layout manager |
72 // for that is returned. Otherwise the layout manager for the default modal | 77 // for that is returned. Otherwise the layout manager for the default modal |
73 // container is returned. | 78 // container is returned. |
74 // If no window is specified (i.e. |window| is NULL), then the lockscreen | 79 // If no window is specified (i.e. |window| is NULL), then the lockscreen |
75 // modal container is used if the screen is currently locked. Otherwise, the | 80 // modal container is used if the screen is currently locked. Otherwise, the |
76 // default modal container is used. | 81 // default modal container is used. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 129 |
125 private: | 130 private: |
126 // Creates each of the special window containers that holds windows of various | 131 // Creates each of the special window containers that holds windows of various |
127 // types in the shell UI. | 132 // types in the shell UI. |
128 void CreateContainersInRootWindow(aura::RootWindow* root_window); | 133 void CreateContainersInRootWindow(aura::RootWindow* root_window); |
129 | 134 |
130 scoped_ptr<aura::RootWindow> root_window_; | 135 scoped_ptr<aura::RootWindow> root_window_; |
131 RootWindowLayoutManager* root_window_layout_; | 136 RootWindowLayoutManager* root_window_layout_; |
132 | 137 |
133 // Widget containing system tray. | 138 // Widget containing system tray. |
134 internal::StatusAreaWidget* status_area_widget_; | 139 StatusAreaWidget* status_area_widget_; |
135 | 140 |
136 // The shelf for managing the launcher and the status widget. | 141 // The shelf for managing the launcher and the status widget. |
137 // RootWindowController does not own the shelf. Instead, it is owned | 142 // RootWindowController does not own the shelf. Instead, it is owned |
138 // by container of the status area. | 143 // by container of the status area. |
139 internal::ShelfLayoutManager* shelf_; | 144 ShelfLayoutManager* shelf_; |
140 | 145 |
141 // Manages layout of panels. Owned by PanelContainer. | 146 // Manages layout of panels. Owned by PanelContainer. |
142 internal::PanelLayoutManager* panel_layout_manager_; | 147 PanelLayoutManager* panel_layout_manager_; |
143 | 148 |
144 scoped_ptr<Launcher> launcher_; | 149 scoped_ptr<Launcher> launcher_; |
145 | 150 |
146 // A background layer that's displayed beneath all other layers. Without | 151 // A background layer that's displayed beneath all other layers. Without |
147 // this, portions of the root window that aren't covered by layers will be | 152 // this, portions of the root window that aren't covered by layers will be |
148 // painted white; this can show up if e.g. it takes a long time to decode the | 153 // painted white; this can show up if e.g. it takes a long time to decode the |
149 // desktop background image when displaying the login screen. | 154 // desktop background image when displaying the login screen. |
150 scoped_ptr<ColoredWindowController> background_; | 155 scoped_ptr<ColoredWindowController> background_; |
151 | 156 |
152 scoped_ptr<ScreenDimmer> screen_dimmer_; | 157 scoped_ptr<ScreenDimmer> screen_dimmer_; |
153 scoped_ptr<WorkspaceController> workspace_controller_; | 158 scoped_ptr<WorkspaceController> workspace_controller_; |
154 | 159 |
155 // We need to own event handlers for various containers. | 160 // We need to own event handlers for various containers. |
156 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; | 161 scoped_ptr<ToplevelWindowEventHandler> default_container_handler_; |
157 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; | 162 scoped_ptr<ToplevelWindowEventHandler> always_on_top_container_handler_; |
158 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; | 163 scoped_ptr<ToplevelWindowEventHandler> modal_container_handler_; |
159 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; | 164 scoped_ptr<ToplevelWindowEventHandler> lock_modal_container_handler_; |
160 | 165 |
161 DISALLOW_COPY_AND_ASSIGN(RootWindowController); | 166 DISALLOW_COPY_AND_ASSIGN(RootWindowController); |
162 }; | 167 }; |
163 | 168 |
164 } // namespace internal | 169 } // namespace internal |
165 } // ash | 170 } // ash |
166 | 171 |
167 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ | 172 #endif // ASH_ROOT_WINDOW_CONTROLLER_H_ |
OLD | NEW |