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

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

Issue 2616023005: cros: Remove OS_CHROMEOS ifdefs in ash/common (Closed)
Patch Set: Created 3 years, 11 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
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
117 virtual void Shutdown(); 114 virtual void Shutdown();
118 115
119 ShellDelegate* delegate() { return delegate_.get(); } 116 ShellDelegate* delegate() { return delegate_.get(); }
120 117
121 AcceleratorController* accelerator_controller() { 118 AcceleratorController* accelerator_controller() {
122 return accelerator_controller_.get(); 119 return accelerator_controller_.get();
123 } 120 }
124 121
125 AccessibilityDelegate* accessibility_delegate() { 122 AccessibilityDelegate* accessibility_delegate() {
126 return accessibility_delegate_.get(); 123 return accessibility_delegate_.get();
127 } 124 }
128 125
129 app_list::AppList* app_list() { return app_list_.get(); } 126 app_list::AppList* app_list() { return app_list_.get(); }
130 127
128 const scoped_refptr<base::SequencedWorkerPool>& blocking_pool() {
129 return blocking_pool_;
130 }
131
131 BrightnessControlDelegate* brightness_control_delegate() { 132 BrightnessControlDelegate* brightness_control_delegate() {
132 return brightness_control_delegate_.get(); 133 return brightness_control_delegate_.get();
133 } 134 }
134 135
135 CastConfigController* cast_config() { return cast_config_.get(); } 136 CastConfigController* cast_config() { return cast_config_.get(); }
136 137
137 FocusCycler* focus_cycler() { return focus_cycler_.get(); } 138 FocusCycler* focus_cycler() { return focus_cycler_.get(); }
138 139
139 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { 140 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() {
140 return keyboard_brightness_control_delegate_.get(); 141 return keyboard_brightness_control_delegate_.get();
141 } 142 }
142 143
143 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } 144 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); }
144 145
145 LocaleNotificationController* locale_notification_controller() { 146 LocaleNotificationController* locale_notification_controller() {
146 return locale_notification_controller_.get(); 147 return locale_notification_controller_.get();
147 } 148 }
148 149
150 LogoutConfirmationController* logout_confirmation_controller() {
151 return logout_confirmation_controller_.get();
152 }
153
149 MaximizeModeController* maximize_mode_controller() { 154 MaximizeModeController* maximize_mode_controller() {
150 return maximize_mode_controller_.get(); 155 return maximize_mode_controller_.get();
151 } 156 }
152 157
153 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } 158 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); }
154 159
155 MediaController* media_controller() { return media_controller_.get(); } 160 MediaController* media_controller() { return media_controller_.get(); }
156 161
157 NewWindowController* new_window_controller() { 162 NewWindowController* new_window_controller() {
158 return new_window_controller_.get(); 163 return new_window_controller_.get();
(...skipping 27 matching lines...) Expand all
186 SystemTrayNotifier* system_tray_notifier() { 191 SystemTrayNotifier* system_tray_notifier() {
187 return system_tray_notifier_.get(); 192 return system_tray_notifier_.get();
188 } 193 }
189 194
190 SystemTrayDelegate* system_tray_delegate() { 195 SystemTrayDelegate* system_tray_delegate() {
191 return system_tray_delegate_.get(); 196 return system_tray_delegate_.get();
192 } 197 }
193 198
194 ToastManager* toast_manager() { return toast_manager_.get(); } 199 ToastManager* toast_manager() { return toast_manager_.get(); }
195 200
201 VpnList* vpn_list() { return vpn_list_.get(); }
202
196 WallpaperController* wallpaper_controller() { 203 WallpaperController* wallpaper_controller() {
197 return wallpaper_controller_.get(); 204 return wallpaper_controller_.get();
198 } 205 }
199 206
200 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); } 207 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); }
201 208
202 WindowCycleController* window_cycle_controller() { 209 WindowCycleController* window_cycle_controller() {
203 return window_cycle_controller_.get(); 210 return window_cycle_controller_.get();
204 } 211 }
205 212
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_;
msw 2017/01/06 18:22:51 nit: maybe sort this alphabetically too, or maybe
James Cook 2017/01/06 20:33:05 Unsorted accessor.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698