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 16 matching lines...) Expand all Loading... | |
27 namespace display { | 27 namespace display { |
28 class Display; | 28 class Display; |
29 class ManagedDisplayInfo; | 29 class ManagedDisplayInfo; |
30 } | 30 } |
31 | 31 |
32 namespace gfx { | 32 namespace gfx { |
33 class Insets; | 33 class Insets; |
34 class Point; | 34 class Point; |
35 } | 35 } |
36 | 36 |
37 namespace shell { | |
38 class Connector; | |
39 } | |
40 | |
37 namespace views { | 41 namespace views { |
38 class PointerWatcher; | 42 class PointerWatcher; |
39 enum class PointerWatcherEventTypes; | 43 enum class PointerWatcherEventTypes; |
40 } | 44 } |
41 | 45 |
42 namespace ash { | 46 namespace ash { |
43 | 47 |
44 class AcceleratorController; | 48 class AcceleratorController; |
45 class AccessibilityDelegate; | 49 class AccessibilityDelegate; |
46 class BrightnessControlDelegate; | 50 class BrightnessControlDelegate; |
47 class FocusCycler; | 51 class FocusCycler; |
48 class ImmersiveContextAsh; | 52 class ImmersiveContextAsh; |
49 class ImmersiveFullscreenController; | 53 class ImmersiveFullscreenController; |
50 class KeyEventWatcher; | 54 class KeyEventWatcher; |
51 class KeyboardBrightnessControlDelegate; | 55 class KeyboardBrightnessControlDelegate; |
52 class KeyboardUI; | 56 class KeyboardUI; |
53 class MaximizeModeController; | 57 class MaximizeModeController; |
54 class MruWindowTracker; | 58 class MruWindowTracker; |
55 class NewWindowDelegate; | 59 class NewWindowDelegate; |
56 class PaletteDelegate; | 60 class PaletteDelegate; |
57 class ScopedDisableInternalMouseAndKeyboard; | 61 class ScopedDisableInternalMouseAndKeyboard; |
58 class SessionStateDelegate; | 62 class SessionStateDelegate; |
59 class ShelfDelegate; | 63 class ShelfDelegate; |
60 class ShelfModel; | 64 class ShelfModel; |
61 class ShelfWindowWatcher; | 65 class ShelfWindowWatcher; |
62 class ShellDelegate; | 66 class ShellDelegate; |
63 class ShellObserver; | 67 class ShellObserver; |
64 class SystemTrayDelegate; | 68 class SystemTrayDelegate; |
69 class SystemTrayController; | |
65 class SystemTrayNotifier; | 70 class SystemTrayNotifier; |
66 class ToastManager; | 71 class ToastManager; |
67 class WallpaperController; | 72 class WallpaperController; |
68 class WallpaperDelegate; | 73 class WallpaperDelegate; |
69 class WindowCycleController; | 74 class WindowCycleController; |
70 class WindowCycleEventFilter; | 75 class WindowCycleEventFilter; |
71 class WindowResizer; | 76 class WindowResizer; |
72 class WindowSelectorController; | 77 class WindowSelectorController; |
73 class WmActivationObserver; | 78 class WmActivationObserver; |
74 class WmDisplayObserver; | 79 class WmDisplayObserver; |
(...skipping 14 matching lines...) Expand all Loading... | |
89 | 94 |
90 // Similar to ash::Shell. Eventually the two will be merged. | 95 // Similar to ash::Shell. Eventually the two will be merged. |
91 class ASH_EXPORT WmShell { | 96 class ASH_EXPORT WmShell { |
92 public: | 97 public: |
93 // This is necessary for a handful of places that is difficult to plumb | 98 // This is necessary for a handful of places that is difficult to plumb |
94 // through context. | 99 // through context. |
95 static void Set(WmShell* instance); | 100 static void Set(WmShell* instance); |
96 static WmShell* Get(); | 101 static WmShell* Get(); |
97 static bool HasInstance() { return instance_ != nullptr; } | 102 static bool HasInstance() { return instance_ != nullptr; } |
98 | 103 |
99 void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool); | 104 void Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool, |
105 ::shell::Connector* connector); | |
100 virtual void Shutdown(); | 106 virtual void Shutdown(); |
101 | 107 |
102 ShellDelegate* delegate() { return delegate_.get(); } | 108 ShellDelegate* delegate() { return delegate_.get(); } |
103 | 109 |
104 AcceleratorController* accelerator_controller() { | 110 AcceleratorController* accelerator_controller() { |
105 return accelerator_controller_.get(); | 111 return accelerator_controller_.get(); |
106 } | 112 } |
107 | 113 |
108 AccessibilityDelegate* accessibility_delegate() { | 114 AccessibilityDelegate* accessibility_delegate() { |
109 return accessibility_delegate_.get(); | 115 return accessibility_delegate_.get(); |
(...skipping 27 matching lines...) Expand all Loading... | |
137 void set_root_window_for_new_windows(WmWindow* root) { | 143 void set_root_window_for_new_windows(WmWindow* root) { |
138 root_window_for_new_windows_ = root; | 144 root_window_for_new_windows_ = root; |
139 } | 145 } |
140 | 146 |
141 PaletteDelegate* palette_delegate() { return palette_delegate_.get(); } | 147 PaletteDelegate* palette_delegate() { return palette_delegate_.get(); } |
142 | 148 |
143 ShelfDelegate* shelf_delegate() { return shelf_delegate_.get(); } | 149 ShelfDelegate* shelf_delegate() { return shelf_delegate_.get(); } |
144 | 150 |
145 ShelfModel* shelf_model() { return shelf_model_.get(); } | 151 ShelfModel* shelf_model() { return shelf_model_.get(); } |
146 | 152 |
153 SystemTrayController* system_tray_controller() { | |
154 return system_tray_controller_.get(); | |
155 } | |
156 | |
147 SystemTrayNotifier* system_tray_notifier() { | 157 SystemTrayNotifier* system_tray_notifier() { |
148 return system_tray_notifier_.get(); | 158 return system_tray_notifier_.get(); |
149 } | 159 } |
150 | 160 |
151 SystemTrayDelegate* system_tray_delegate() { | 161 SystemTrayDelegate* system_tray_delegate() { |
152 return system_tray_delegate_.get(); | 162 return system_tray_delegate_.get(); |
153 } | 163 } |
154 | 164 |
155 ToastManager* toast_manager() { return toast_manager_.get(); } | 165 ToastManager* toast_manager() { return toast_manager_.get(); } |
156 | 166 |
157 WallpaperController* wallpaper_controller() { | 167 WallpaperController* wallpaper_controller() { |
158 return wallpaper_controller_.get(); | 168 return wallpaper_controller_.get(); |
159 } | 169 } |
160 | 170 |
161 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); } | 171 WallpaperDelegate* wallpaper_delegate() { return wallpaper_delegate_.get(); } |
162 | 172 |
163 WindowCycleController* window_cycle_controller() { | 173 WindowCycleController* window_cycle_controller() { |
164 return window_cycle_controller_.get(); | 174 return window_cycle_controller_.get(); |
165 } | 175 } |
166 | 176 |
167 WindowSelectorController* window_selector_controller() { | 177 WindowSelectorController* window_selector_controller() { |
168 return window_selector_controller_.get(); | 178 return window_selector_controller_.get(); |
169 } | 179 } |
170 | 180 |
181 // Returns true when ash is running in its own process. | |
msw
2016/09/30 23:26:49
nit: s/process/mojo application/? (might still be
James Cook
2016/10/03 18:07:56
Done.
| |
182 virtual bool IsRunningInMash() const = 0; | |
183 | |
171 virtual WmWindow* NewWindow(ui::wm::WindowType window_type, | 184 virtual WmWindow* NewWindow(ui::wm::WindowType window_type, |
172 ui::LayerType layer_type) = 0; | 185 ui::LayerType layer_type) = 0; |
173 | 186 |
174 virtual WmWindow* GetFocusedWindow() = 0; | 187 virtual WmWindow* GetFocusedWindow() = 0; |
175 virtual WmWindow* GetActiveWindow() = 0; | 188 virtual WmWindow* GetActiveWindow() = 0; |
176 | 189 |
177 virtual WmWindow* GetCaptureWindow() = 0; | 190 virtual WmWindow* GetCaptureWindow() = 0; |
178 | 191 |
179 // Convenience for GetPrimaryRootWindow()->GetRootWindowController(). | 192 // Convenience for GetPrimaryRootWindow()->GetRootWindowController(). |
180 WmRootWindowController* GetPrimaryRootWindowController(); | 193 WmRootWindowController* GetPrimaryRootWindowController(); |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 keyboard_brightness_control_delegate_; | 459 keyboard_brightness_control_delegate_; |
447 std::unique_ptr<KeyboardUI> keyboard_ui_; | 460 std::unique_ptr<KeyboardUI> keyboard_ui_; |
448 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; | 461 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; |
449 std::unique_ptr<MediaDelegate> media_delegate_; | 462 std::unique_ptr<MediaDelegate> media_delegate_; |
450 std::unique_ptr<MruWindowTracker> mru_window_tracker_; | 463 std::unique_ptr<MruWindowTracker> mru_window_tracker_; |
451 std::unique_ptr<NewWindowDelegate> new_window_delegate_; | 464 std::unique_ptr<NewWindowDelegate> new_window_delegate_; |
452 std::unique_ptr<PaletteDelegate> palette_delegate_; | 465 std::unique_ptr<PaletteDelegate> palette_delegate_; |
453 std::unique_ptr<ShelfDelegate> shelf_delegate_; | 466 std::unique_ptr<ShelfDelegate> shelf_delegate_; |
454 std::unique_ptr<ShelfModel> shelf_model_; | 467 std::unique_ptr<ShelfModel> shelf_model_; |
455 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_; | 468 std::unique_ptr<ShelfWindowWatcher> shelf_window_watcher_; |
469 std::unique_ptr<SystemTrayController> system_tray_controller_; | |
456 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 470 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
457 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 471 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
458 std::unique_ptr<ToastManager> toast_manager_; | 472 std::unique_ptr<ToastManager> toast_manager_; |
459 std::unique_ptr<WallpaperController> wallpaper_controller_; | 473 std::unique_ptr<WallpaperController> wallpaper_controller_; |
460 std::unique_ptr<WallpaperDelegate> wallpaper_delegate_; | 474 std::unique_ptr<WallpaperDelegate> wallpaper_delegate_; |
461 std::unique_ptr<WindowCycleController> window_cycle_controller_; | 475 std::unique_ptr<WindowCycleController> window_cycle_controller_; |
462 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 476 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
463 | 477 |
464 base::ObserverList<LockStateObserver> lock_state_observers_; | 478 base::ObserverList<LockStateObserver> lock_state_observers_; |
465 | 479 |
466 // See comment for GetRootWindowForNewWindows(). | 480 // See comment for GetRootWindowForNewWindows(). |
467 WmWindow* root_window_for_new_windows_ = nullptr; | 481 WmWindow* root_window_for_new_windows_ = nullptr; |
468 WmWindow* scoped_root_window_for_new_windows_ = nullptr; | 482 WmWindow* scoped_root_window_for_new_windows_ = nullptr; |
469 | 483 |
470 bool simulate_modal_window_open_for_testing_ = false; | 484 bool simulate_modal_window_open_for_testing_ = false; |
471 | 485 |
472 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; | 486 scoped_refptr<base::SequencedWorkerPool> blocking_pool_; |
473 | 487 |
474 #if defined(OS_CHROMEOS) | 488 #if defined(OS_CHROMEOS) |
475 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 489 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
476 #endif | 490 #endif |
477 }; | 491 }; |
478 | 492 |
479 } // namespace ash | 493 } // namespace ash |
480 | 494 |
481 #endif // ASH_COMMON_WM_SHELL_H_ | 495 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |