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

Side by Side Diff: ash/common/wm_shell.h

Issue 2118593002: mash: Migrate ShellDelegate ownership and access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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
« no previous file with comments | « ash/common/shell_delegate.h ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15 matching lines...) Expand all
26 namespace ash { 26 namespace ash {
27 27
28 class AccessibilityDelegate; 28 class AccessibilityDelegate;
29 class DisplayInfo; 29 class DisplayInfo;
30 class FocusCycler; 30 class FocusCycler;
31 class KeyboardUI; 31 class KeyboardUI;
32 class MaximizeModeController; 32 class MaximizeModeController;
33 class MruWindowTracker; 33 class MruWindowTracker;
34 class ScopedDisableInternalMouseAndKeyboard; 34 class ScopedDisableInternalMouseAndKeyboard;
35 class SessionStateDelegate; 35 class SessionStateDelegate;
36 class ShellDelegate;
36 class ShellObserver; 37 class ShellObserver;
37 class SystemTrayDelegate; 38 class SystemTrayDelegate;
38 class SystemTrayNotifier; 39 class SystemTrayNotifier;
39 class WindowResizer; 40 class WindowResizer;
40 class WindowSelectorController; 41 class WindowSelectorController;
41 class WmActivationObserver; 42 class WmActivationObserver;
42 class WmDisplayObserver; 43 class WmDisplayObserver;
43 class WmRootWindowController; 44 class WmRootWindowController;
44 class WmWindow; 45 class WmWindow;
45 46
46 namespace wm { 47 namespace wm {
47 class MaximizeModeEventHandler; 48 class MaximizeModeEventHandler;
48 class WindowState; 49 class WindowState;
49 } 50 }
50 51
51 #if defined(OS_CHROMEOS) 52 #if defined(OS_CHROMEOS)
52 class LogoutConfirmationController; 53 class LogoutConfirmationController;
53 #endif 54 #endif
54 55
55 // Similar to ash::Shell. Eventually the two will be merged. 56 // Similar to ash::Shell. Eventually the two will be merged.
56 class ASH_EXPORT WmShell { 57 class ASH_EXPORT WmShell {
57 public: 58 public:
58 // This is necessary for a handful of places that is difficult to plumb 59 // This is necessary for a handful of places that is difficult to plumb
59 // through context. 60 // through context.
60 static void Set(WmShell* instance); 61 static void Set(WmShell* instance);
61 static WmShell* Get(); 62 static WmShell* Get();
62 static bool HasInstance() { return instance_ != nullptr; } 63 static bool HasInstance() { return instance_ != nullptr; }
63 64
65 ShellDelegate* delegate() { return delegate_.get(); }
66
64 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 67 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
65 68
66 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } 69 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
67 70
68 MaximizeModeController* maximize_mode_controller() { 71 MaximizeModeController* maximize_mode_controller() {
69 return maximize_mode_controller_.get(); 72 return maximize_mode_controller_.get();
70 } 73 }
71 74
72 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } 75 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
73 76
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #if defined(OS_CHROMEOS) 203 #if defined(OS_CHROMEOS)
201 LogoutConfirmationController* logout_confirmation_controller() { 204 LogoutConfirmationController* logout_confirmation_controller() {
202 return logout_confirmation_controller_.get(); 205 return logout_confirmation_controller_.get();
203 } 206 }
204 207
205 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. 208 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved.
206 virtual void ToggleIgnoreExternalKeyboard() = 0; 209 virtual void ToggleIgnoreExternalKeyboard() = 0;
207 #endif 210 #endif
208 211
209 protected: 212 protected:
210 WmShell(); 213 explicit WmShell(ShellDelegate* delegate);
211 virtual ~WmShell(); 214 virtual ~WmShell();
212 215
213 base::ObserverList<ShellObserver>* shell_observers() { 216 base::ObserverList<ShellObserver>* shell_observers() {
214 return &shell_observers_; 217 return &shell_observers_;
215 } 218 }
216 219
217 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); 220 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui);
218 221
219 // Helpers to set (and initialize) or destroy various delegates. 222 // Helpers to set (and initialize) or destroy various delegates.
220 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported. 223 // TODO(msw|jamescook): Remove these once ShellDelegate, etc. are ported.
221 void SetMediaDelegate(std::unique_ptr<MediaDelegate> delegate); 224 void SetMediaDelegate(std::unique_ptr<MediaDelegate> delegate);
222 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); 225 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate);
223 void DeleteSystemTrayDelegate(); 226 void DeleteSystemTrayDelegate();
224 227
225 void DeleteWindowSelectorController(); 228 void DeleteWindowSelectorController();
226 229
227 void CreateMaximizeModeController(); 230 void CreateMaximizeModeController();
228 void DeleteMaximizeModeController(); 231 void DeleteMaximizeModeController();
229 232
230 void CreateMruWindowTracker(); 233 void CreateMruWindowTracker();
231 void DeleteMruWindowTracker(); 234 void DeleteMruWindowTracker();
232 235
233 private: 236 private:
234 friend class Shell; 237 friend class Shell;
235 238
236 static WmShell* instance_; 239 static WmShell* instance_;
237 240
238 base::ObserverList<ShellObserver> shell_observers_; 241 base::ObserverList<ShellObserver> shell_observers_;
239 242 std::unique_ptr<ShellDelegate> delegate_;
240 std::unique_ptr<FocusCycler> focus_cycler_; 243 std::unique_ptr<FocusCycler> focus_cycler_;
241 std::unique_ptr<KeyboardUI> keyboard_ui_; 244 std::unique_ptr<KeyboardUI> keyboard_ui_;
242 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; 245 std::unique_ptr<MaximizeModeController> maximize_mode_controller_;
243 std::unique_ptr<MediaDelegate> media_delegate_; 246 std::unique_ptr<MediaDelegate> media_delegate_;
244 std::unique_ptr<MruWindowTracker> mru_window_tracker_; 247 std::unique_ptr<MruWindowTracker> mru_window_tracker_;
245 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; 248 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_;
246 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; 249 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
247 std::unique_ptr<WindowSelectorController> window_selector_controller_; 250 std::unique_ptr<WindowSelectorController> window_selector_controller_;
248 251
249 bool simulate_modal_window_open_for_testing_ = false; 252 bool simulate_modal_window_open_for_testing_ = false;
250 253
251 #if defined(OS_CHROMEOS) 254 #if defined(OS_CHROMEOS)
252 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; 255 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_;
253 #endif 256 #endif
254 }; 257 };
255 258
256 } // namespace ash 259 } // namespace ash
257 260
258 #endif // ASH_COMMON_WM_SHELL_H_ 261 #endif // ASH_COMMON_WM_SHELL_H_
OLDNEW
« no previous file with comments | « ash/common/shell_delegate.h ('k') | ash/common/wm_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698