OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_COMMON_WM_SHELL_H_ | 5 #ifndef ASH_COMMON_WM_SHELL_H_ |
6 #define ASH_COMMON_WM_SHELL_H_ | 6 #define ASH_COMMON_WM_SHELL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
25 | 25 |
26 class AccessibilityDelegate; | 26 class AccessibilityDelegate; |
27 class DisplayInfo; | 27 class DisplayInfo; |
28 class FocusCycler; | 28 class FocusCycler; |
29 class MruWindowTracker; | 29 class MruWindowTracker; |
30 class SessionStateDelegate; | 30 class SessionStateDelegate; |
31 class ShellObserver; | 31 class ShellObserver; |
32 class SystemTrayDelegate; | 32 class SystemTrayDelegate; |
| 33 class SystemTrayNotifier; |
33 class WindowResizer; | 34 class WindowResizer; |
34 class WindowSelectorController; | 35 class WindowSelectorController; |
35 class WmActivationObserver; | 36 class WmActivationObserver; |
36 class WmDisplayObserver; | 37 class WmDisplayObserver; |
37 class SystemTrayNotifier; | 38 class WmRootWindowController; |
38 class WmWindow; | 39 class WmWindow; |
39 | 40 |
40 namespace wm { | 41 namespace wm { |
41 class WindowState; | 42 class WindowState; |
42 } | 43 } |
43 | 44 |
| 45 #if defined(OS_CHROMEOS) |
| 46 class LogoutConfirmationController; |
| 47 #endif |
| 48 |
44 // Similar to ash::Shell. Eventually the two will be merged. | 49 // Similar to ash::Shell. Eventually the two will be merged. |
45 class ASH_EXPORT WmShell { | 50 class ASH_EXPORT WmShell { |
46 public: | 51 public: |
47 // This is necessary for a handful of places that is difficult to plumb | 52 // This is necessary for a handful of places that is difficult to plumb |
48 // through context. | 53 // through context. |
49 static void Set(WmShell* instance); | 54 static void Set(WmShell* instance); |
50 static WmShell* Get(); | 55 static WmShell* Get(); |
51 static bool HasInstance() { return instance_ != nullptr; } | 56 static bool HasInstance() { return instance_ != nullptr; } |
52 | 57 |
53 FocusCycler* focus_cycler() { return focus_cycler_.get(); } | 58 FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; | 155 virtual void AddDisplayObserver(WmDisplayObserver* observer) = 0; |
151 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; | 156 virtual void RemoveDisplayObserver(WmDisplayObserver* observer) = 0; |
152 | 157 |
153 virtual void AddShellObserver(ShellObserver* observer) = 0; | 158 virtual void AddShellObserver(ShellObserver* observer) = 0; |
154 virtual void RemoveShellObserver(ShellObserver* observer) = 0; | 159 virtual void RemoveShellObserver(ShellObserver* observer) = 0; |
155 | 160 |
156 virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0; | 161 virtual void AddPointerWatcher(views::PointerWatcher* watcher) = 0; |
157 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; | 162 virtual void RemovePointerWatcher(views::PointerWatcher* watcher) = 0; |
158 | 163 |
159 #if defined(OS_CHROMEOS) | 164 #if defined(OS_CHROMEOS) |
| 165 LogoutConfirmationController* logout_confirmation_controller() { |
| 166 return logout_confirmation_controller_.get(); |
| 167 } |
| 168 |
160 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 169 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
161 virtual void ToggleIgnoreExternalKeyboard() = 0; | 170 virtual void ToggleIgnoreExternalKeyboard() = 0; |
162 #endif | 171 #endif |
163 | 172 |
164 protected: | 173 protected: |
165 WmShell(); | 174 WmShell(); |
166 virtual ~WmShell(); | 175 virtual ~WmShell(); |
167 | 176 |
168 // If |delegate| is not null, sets and initializes the delegate. If |delegate| | 177 // Sets and initializes the |delegate|. |
169 // is null, shuts down and destroys the delegate. | |
170 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 178 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 179 void DeleteSystemTrayDelegate(); |
171 | 180 |
172 void DeleteWindowSelectorController(); | 181 void DeleteWindowSelectorController(); |
173 | 182 |
174 private: | 183 private: |
175 friend class Shell; | 184 friend class Shell; |
176 | 185 |
177 static WmShell* instance_; | 186 static WmShell* instance_; |
178 | 187 |
179 std::unique_ptr<FocusCycler> focus_cycler_; | 188 std::unique_ptr<FocusCycler> focus_cycler_; |
180 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 189 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
181 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 190 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
182 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 191 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
183 | 192 |
184 bool simulate_modal_window_open_for_testing_ = false; | 193 bool simulate_modal_window_open_for_testing_ = false; |
| 194 |
| 195 #if defined(OS_CHROMEOS) |
| 196 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
| 197 #endif |
185 }; | 198 }; |
186 | 199 |
187 } // namespace ash | 200 } // namespace ash |
188 | 201 |
189 #endif // ASH_COMMON_WM_SHELL_H_ | 202 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |