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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 class AccessibilityDelegate; | 53 class AccessibilityDelegate; |
54 class BrightnessControlDelegate; | 54 class BrightnessControlDelegate; |
55 class CastConfigController; | 55 class CastConfigController; |
56 class FocusCycler; | 56 class FocusCycler; |
57 class ImmersiveContextAsh; | 57 class ImmersiveContextAsh; |
58 class ImmersiveFullscreenController; | 58 class ImmersiveFullscreenController; |
59 class KeyEventWatcher; | 59 class KeyEventWatcher; |
60 class KeyboardBrightnessControlDelegate; | 60 class KeyboardBrightnessControlDelegate; |
61 class KeyboardUI; | 61 class KeyboardUI; |
62 class LocaleNotificationController; | 62 class LocaleNotificationController; |
| 63 class LogoutConfirmationController; |
63 class MaximizeModeController; | 64 class MaximizeModeController; |
64 class MediaController; | 65 class MediaController; |
65 class MruWindowTracker; | 66 class MruWindowTracker; |
66 class NewWindowController; | 67 class NewWindowController; |
67 class PaletteDelegate; | 68 class PaletteDelegate; |
68 class ScopedDisableInternalMouseAndKeyboard; | 69 class ScopedDisableInternalMouseAndKeyboard; |
69 class SessionController; | 70 class SessionController; |
70 class SessionStateDelegate; | 71 class SessionStateDelegate; |
71 class ShelfController; | 72 class ShelfController; |
72 class ShelfDelegate; | 73 class ShelfDelegate; |
73 class ShelfModel; | 74 class ShelfModel; |
74 class ShelfWindowWatcher; | 75 class ShelfWindowWatcher; |
75 class ShellDelegate; | 76 class ShellDelegate; |
76 class ShellObserver; | 77 class ShellObserver; |
77 class ShutdownController; | 78 class ShutdownController; |
78 class SystemTrayDelegate; | 79 class SystemTrayDelegate; |
79 class SystemTrayController; | 80 class SystemTrayController; |
80 class SystemTrayNotifier; | 81 class SystemTrayNotifier; |
81 class ToastManager; | 82 class ToastManager; |
| 83 class VpnList; |
82 class WallpaperController; | 84 class WallpaperController; |
83 class WallpaperDelegate; | 85 class WallpaperDelegate; |
84 class WindowCycleController; | 86 class WindowCycleController; |
85 class WindowCycleEventFilter; | 87 class WindowCycleEventFilter; |
86 class WindowResizer; | 88 class WindowResizer; |
87 class WindowSelectorController; | 89 class WindowSelectorController; |
88 class WmActivationObserver; | 90 class WmActivationObserver; |
89 class WmDisplayObserver; | 91 class WmDisplayObserver; |
90 class WmRootWindowController; | 92 class WmRootWindowController; |
91 class WmWindow; | 93 class WmWindow; |
92 class WorkspaceEventHandler; | 94 class WorkspaceEventHandler; |
93 | 95 |
94 enum class LoginStatus; | 96 enum class LoginStatus; |
95 enum class TaskSwitchSource; | 97 enum class TaskSwitchSource; |
96 | 98 |
97 namespace wm { | 99 namespace wm { |
98 class MaximizeModeEventHandler; | 100 class MaximizeModeEventHandler; |
99 class WindowState; | 101 class WindowState; |
100 } | 102 } |
101 | 103 |
102 #if defined(OS_CHROMEOS) | |
103 class LogoutConfirmationController; | |
104 class VpnList; | |
105 #endif | |
106 | |
107 // Similar to ash::Shell. Eventually the two will be merged. | 104 // Similar to ash::Shell. Eventually the two will be merged. |
108 class ASH_EXPORT WmShell : public SessionStateObserver { | 105 class ASH_EXPORT WmShell : public SessionStateObserver { |
109 public: | 106 public: |
110 // This is necessary for a handful of places that is difficult to plumb | 107 // This is necessary for a handful of places that is difficult to plumb |
111 // through context. | 108 // through context. |
112 static void Set(WmShell* instance); | 109 static void Set(WmShell* instance); |
113 static WmShell* Get(); | 110 static WmShell* Get(); |
114 static bool HasInstance() { return instance_ != nullptr; } | 111 static bool HasInstance() { return instance_ != nullptr; } |
115 | 112 |
116 void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool); | 113 void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool); |
(...skipping 22 matching lines...) Expand all Loading... |
139 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { | 136 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { |
140 return keyboard_brightness_control_delegate_.get(); | 137 return keyboard_brightness_control_delegate_.get(); |
141 } | 138 } |
142 | 139 |
143 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } | 140 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } |
144 | 141 |
145 LocaleNotificationController* locale_notification_controller() { | 142 LocaleNotificationController* locale_notification_controller() { |
146 return locale_notification_controller_.get(); | 143 return locale_notification_controller_.get(); |
147 } | 144 } |
148 | 145 |
| 146 LogoutConfirmationController* logout_confirmation_controller() { |
| 147 return logout_confirmation_controller_.get(); |
| 148 } |
| 149 |
149 MaximizeModeController* maximize_mode_controller() { | 150 MaximizeModeController* maximize_mode_controller() { |
150 return maximize_mode_controller_.get(); | 151 return maximize_mode_controller_.get(); |
151 } | 152 } |
152 | 153 |
153 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } | 154 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } |
154 | 155 |
155 MediaController* media_controller() { return media_controller_.get(); } | 156 MediaController* media_controller() { return media_controller_.get(); } |
156 | 157 |
157 NewWindowController* new_window_controller() { | 158 NewWindowController* new_window_controller() { |
158 return new_window_controller_.get(); | 159 return new_window_controller_.get(); |
(...skipping 27 matching lines...) Expand all Loading... |
186 SystemTrayNotifier* system_tray_notifier() { | 187 SystemTrayNotifier* system_tray_notifier() { |
187 return system_tray_notifier_.get(); | 188 return system_tray_notifier_.get(); |
188 } | 189 } |
189 | 190 |
190 SystemTrayDelegate* system_tray_delegate() { | 191 SystemTrayDelegate* system_tray_delegate() { |
191 return system_tray_delegate_.get(); | 192 return system_tray_delegate_.get(); |
192 } | 193 } |
193 | 194 |
194 ToastManager* toast_manager() { return toast_manager_.get(); } | 195 ToastManager* toast_manager() { return toast_manager_.get(); } |
195 | 196 |
| 197 VpnList* vpn_list() { return vpn_list_.get(); } |
| 198 |
196 WallpaperController* wallpaper_controller() { | 199 WallpaperController* wallpaper_controller() { |
197 return wallpaper_controller_.get(); | 200 return wallpaper_controller_.get(); |
198 } | 201 } |
199 | 202 |
200 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); } | 203 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); } |
201 | 204 |
202 WindowCycleController* window_cycle_controller() { | 205 WindowCycleController* window_cycle_controller() { |
203 return window_cycle_controller_.get(); | 206 return window_cycle_controller_.get(); |
204 } | 207 } |
205 | 208 |
206 WindowSelectorController* window_selector_controller() { | 209 WindowSelectorController* window_selector_controller() { |
207 return window_selector_controller_.get(); | 210 return window_selector_controller_.get(); |
208 } | 211 } |
209 | 212 |
| 213 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool() { |
| 214 return blocking_pool_; |
| 215 } |
| 216 |
210 // Returns true when ash is running as a service_manager::Service. | 217 // Returns true when ash is running as a service_manager::Service. |
211 virtual bool IsRunningInMash() const = 0; | 218 virtual bool IsRunningInMash() const = 0; |
212 | 219 |
213 virtual WmWindow* NewWindow(ui::wm::WindowType window_type, | 220 virtual WmWindow* NewWindow(ui::wm::WindowType window_type, |
214 ui::LayerType layer_type) = 0; | 221 ui::LayerType layer_type) = 0; |
215 | 222 |
216 virtual WmWindow* GetFocusedWindow() = 0; | 223 virtual WmWindow* GetFocusedWindow() = 0; |
217 virtual WmWindow* GetActiveWindow() = 0; | 224 virtual WmWindow* GetActiveWindow() = 0; |
218 | 225 |
219 virtual WmWindow* GetCaptureWindow() = 0; | 226 virtual WmWindow* GetCaptureWindow() = 0; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // it is available to code in ash/common. | 430 // it is available to code in ash/common. |
424 virtual void RequestShutdown() = 0; | 431 virtual void RequestShutdown() = 0; |
425 | 432 |
426 void SetShelfDelegateForTesting(std::unique_ptr<ShelfDelegate> test_delegate); | 433 void SetShelfDelegateForTesting(std::unique_ptr<ShelfDelegate> test_delegate); |
427 void SetPaletteDelegateForTesting( | 434 void SetPaletteDelegateForTesting( |
428 std::unique_ptr<PaletteDelegate> palette_delegate); | 435 std::unique_ptr<PaletteDelegate> palette_delegate); |
429 | 436 |
430 // True if any touch points are down. | 437 // True if any touch points are down. |
431 virtual bool IsTouchDown() = 0; | 438 virtual bool IsTouchDown() = 0; |
432 | 439 |
433 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool() { | |
434 return blocking_pool_; | |
435 } | |
436 | |
437 #if defined(OS_CHROMEOS) | |
438 LogoutConfirmationController* logout_confirmation_controller() { | |
439 return logout_confirmation_controller_.get(); | |
440 } | |
441 | |
442 VpnList* vpn_list() { return vpn_list_.get(); } | |
443 | |
444 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 440 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
445 virtual void ToggleIgnoreExternalKeyboard() = 0; | 441 virtual void ToggleIgnoreExternalKeyboard() = 0; |
446 | 442 |
447 // Enable or disable the laser pointer. | 443 // Enable or disable the laser pointer. |
448 virtual void SetLaserPointerEnabled(bool enabled) = 0; | 444 virtual void SetLaserPointerEnabled(bool enabled) = 0; |
449 #endif | |
450 | 445 |
451 protected: | 446 protected: |
452 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); | 447 explicit WmShell(std::unique_ptr<ShellDelegate> shell_delegate); |
453 ~WmShell() override; | 448 ~WmShell() override; |
454 | 449 |
455 base::ObserverList<ShellObserver>* shell_observers() { | 450 base::ObserverList<ShellObserver>* shell_observers() { |
456 return &shell_observers_; | 451 return &shell_observers_; |
457 } | 452 } |
458 | 453 |
459 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); | 454 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; | 493 std::unique_ptr<AccessibilityDelegate> accessibility_delegate_; |
499 std::unique_ptr<app_list::AppList> app_list_; | 494 std::unique_ptr<app_list::AppList> app_list_; |
500 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; | 495 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
501 std::unique_ptr<CastConfigController> cast_config_; | 496 std::unique_ptr<CastConfigController> cast_config_; |
502 std::unique_ptr<FocusCycler> focus_cycler_; | 497 std::unique_ptr<FocusCycler> focus_cycler_; |
503 std::unique_ptr<ImmersiveContextAsh> immersive_context_; | 498 std::unique_ptr<ImmersiveContextAsh> immersive_context_; |
504 std::unique_ptr<KeyboardBrightnessControlDelegate> | 499 std::unique_ptr<KeyboardBrightnessControlDelegate> |
505 keyboard_brightness_control_delegate_; | 500 keyboard_brightness_control_delegate_; |
506 std::unique_ptr<KeyboardUI> keyboard_ui_; | 501 std::unique_ptr<KeyboardUI> keyboard_ui_; |
507 std::unique_ptr<LocaleNotificationController> locale_notification_controller_; | 502 std::unique_ptr<LocaleNotificationController> locale_notification_controller_; |
| 503 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
508 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; | 504 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; |
509 std::unique_ptr<MediaController> media_controller_; | 505 std::unique_ptr<MediaController> media_controller_; |
510 std::unique_ptr<MruWindowTracker> mru_window_tracker_; | 506 std::unique_ptr<MruWindowTracker> mru_window_tracker_; |
511 std::unique_ptr<NewWindowController> new_window_controller_; | 507 std::unique_ptr<NewWindowController> new_window_controller_; |
512 std::unique_ptr<PaletteDelegate> palette_delegate_; | 508 std::unique_ptr<PaletteDelegate> palette_delegate_; |
513 std::unique_ptr<SessionController> session_controller_; | 509 std::unique_ptr<SessionController> session_controller_; |
514 std::unique_ptr<ShelfController> shelf_controller_; | 510 std::unique_ptr<ShelfController> shelf_controller_; |
515 std::unique_ptr<ShelfDelegate> shelf_delegate_; | 511 std::unique_ptr<ShelfDelegate> shelf_delegate_; |
516 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_; | 512 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_; |
517 std::unique_ptr<ShutdownController> shutdown_controller_; | 513 std::unique_ptr<ShutdownController> shutdown_controller_; |
518 std::unique_ptr<SystemTrayController> system_tray_controller_; | 514 std::unique_ptr<SystemTrayController> system_tray_controller_; |
519 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 515 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
520 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 516 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
521 std::unique_ptr<ToastManager> toast_manager_; | 517 std::unique_ptr<ToastManager> toast_manager_; |
| 518 std::unique_ptr<VpnList> vpn_list_; |
522 std::unique_ptr<WallpaperController> wallpaper_controller_; | 519 std::unique_ptr<WallpaperController> wallpaper_controller_; |
523 std::unique_ptr<WallpaperDelegate> wallpaper_delegate_; | 520 std::unique_ptr<WallpaperDelegate> wallpaper_delegate_; |
524 std::unique_ptr<WindowCycleController> window_cycle_controller_; | 521 std::unique_ptr<WindowCycleController> window_cycle_controller_; |
525 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 522 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
526 std::unique_ptr<ui::devtools::UiDevToolsServer> devtools_server_; | 523 std::unique_ptr<ui::devtools::UiDevToolsServer> devtools_server_; |
527 | 524 |
528 base::ObserverList<LockStateObserver> lock_state_observers_; | 525 base::ObserverList<LockStateObserver> lock_state_observers_; |
529 | 526 |
530 // See comment for GetRootWindowForNewWindows(). | 527 // See comment for GetRootWindowForNewWindows(). |
531 WmWindow* root_window_for_new_windows_ = nullptr; | 528 WmWindow* root_window_for_new_windows_ = nullptr; |
532 WmWindow* scoped_root_window_for_new_windows_ = nullptr; | 529 WmWindow* scoped_root_window_for_new_windows_ = nullptr; |
533 | 530 |
534 bool simulate_modal_window_open_for_testing_ = false; | 531 bool simulate_modal_window_open_for_testing_ = false; |
535 | 532 |
536 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 533 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
537 | |
538 #if defined(OS_CHROMEOS) | |
539 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | |
540 std::unique_ptr<VpnList> vpn_list_; | |
541 #endif | |
542 }; | 534 }; |
543 | 535 |
544 } // namespace ash | 536 } // namespace ash |
545 | 537 |
546 #endif // ASH_COMMON_WM_SHELL_H_ | 538 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |