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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ash/ash_export.h" | 13 #include "ash/ash_export.h" |
14 #include "ash/common/media_delegate.h" | 14 #include "ash/common/media_delegate.h" |
15 #include "ash/common/metrics/user_metrics_action.h" | 15 #include "ash/common/metrics/user_metrics_action.h" |
16 #include "base/observer_list.h" | 16 #include "base/observer_list.h" |
17 | 17 |
18 namespace gfx { | |
19 class Rect; | |
20 } | |
21 | |
22 namespace views { | 18 namespace views { |
23 class PointerWatcher; | 19 class PointerWatcher; |
24 } | 20 } |
25 | 21 |
26 namespace ash { | 22 namespace ash { |
27 | 23 |
28 class AccessibilityDelegate; | 24 class AccessibilityDelegate; |
| 25 class BrightnessControlDelegate; |
29 class DisplayInfo; | 26 class DisplayInfo; |
30 class FocusCycler; | 27 class FocusCycler; |
| 28 class KeyboardBrightnessControlDelegate; |
31 class KeyboardUI; | 29 class KeyboardUI; |
32 class MaximizeModeController; | 30 class MaximizeModeController; |
33 class MruWindowTracker; | 31 class MruWindowTracker; |
34 class ScopedDisableInternalMouseAndKeyboard; | 32 class ScopedDisableInternalMouseAndKeyboard; |
35 class SessionStateDelegate; | 33 class SessionStateDelegate; |
36 class ShellDelegate; | 34 class ShellDelegate; |
37 class ShellObserver; | 35 class ShellObserver; |
38 class SystemTrayDelegate; | 36 class SystemTrayDelegate; |
39 class SystemTrayNotifier; | 37 class SystemTrayNotifier; |
40 class WindowResizer; | 38 class WindowResizer; |
41 class WindowSelectorController; | 39 class WindowSelectorController; |
42 class WmActivationObserver; | 40 class WmActivationObserver; |
43 class WmDisplayObserver; | 41 class WmDisplayObserver; |
44 class WmRootWindowController; | |
45 class WmWindow; | 42 class WmWindow; |
46 | 43 |
47 namespace wm { | 44 namespace wm { |
48 class MaximizeModeEventHandler; | 45 class MaximizeModeEventHandler; |
49 class WindowState; | 46 class WindowState; |
50 } | 47 } |
51 | 48 |
52 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
53 class LogoutConfirmationController; | 50 class LogoutConfirmationController; |
54 #endif | 51 #endif |
55 | 52 |
56 // Similar to ash::Shell. Eventually the two will be merged. | 53 // Similar to ash::Shell. Eventually the two will be merged. |
57 class ASH_EXPORT WmShell { | 54 class ASH_EXPORT WmShell { |
58 public: | 55 public: |
59 // This is necessary for a handful of places that is difficult to plumb | 56 // This is necessary for a handful of places that is difficult to plumb |
60 // through context. | 57 // through context. |
61 static void Set(WmShell* instance); | 58 static void Set(WmShell* instance); |
62 static WmShell* Get(); | 59 static WmShell* Get(); |
63 static bool HasInstance() { return instance_ != nullptr; } | 60 static bool HasInstance() { return instance_ != nullptr; } |
64 | 61 |
65 ShellDelegate* delegate() { return delegate_.get(); } | 62 ShellDelegate* delegate() { return delegate_.get(); } |
66 | 63 |
| 64 BrightnessControlDelegate* brightness_control_delegate() { |
| 65 return brightness_control_delegate_.get(); |
| 66 } |
| 67 |
67 FocusCycler* focus_cycler() { return focus_cycler_.get(); } | 68 FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
68 | 69 |
| 70 KeyboardBrightnessControlDelegate* keyboard_brightness_control_delegate() { |
| 71 return keyboard_brightness_control_delegate_.get(); |
| 72 } |
| 73 |
69 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } | 74 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } |
70 | 75 |
71 MaximizeModeController* maximize_mode_controller() { | 76 MaximizeModeController* maximize_mode_controller() { |
72 return maximize_mode_controller_.get(); | 77 return maximize_mode_controller_.get(); |
73 } | 78 } |
74 | 79 |
75 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } | 80 MruWindowTracker* mru_window_tracker() { return mru_window_tracker_.get(); } |
76 | 81 |
77 MediaDelegate* media_delegate() { return media_delegate_.get(); } | 82 MediaDelegate* media_delegate() { return media_delegate_.get(); } |
78 | 83 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 232 |
228 void DeleteWindowSelectorController(); | 233 void DeleteWindowSelectorController(); |
229 | 234 |
230 void CreateMaximizeModeController(); | 235 void CreateMaximizeModeController(); |
231 void DeleteMaximizeModeController(); | 236 void DeleteMaximizeModeController(); |
232 | 237 |
233 void CreateMruWindowTracker(); | 238 void CreateMruWindowTracker(); |
234 void DeleteMruWindowTracker(); | 239 void DeleteMruWindowTracker(); |
235 | 240 |
236 private: | 241 private: |
| 242 friend class AcceleratorControllerTest; |
237 friend class Shell; | 243 friend class Shell; |
238 | 244 |
239 static WmShell* instance_; | 245 static WmShell* instance_; |
240 | 246 |
241 base::ObserverList<ShellObserver> shell_observers_; | 247 base::ObserverList<ShellObserver> shell_observers_; |
242 std::unique_ptr<ShellDelegate> delegate_; | 248 std::unique_ptr<ShellDelegate> delegate_; |
| 249 |
| 250 std::unique_ptr<BrightnessControlDelegate> brightness_control_delegate_; |
243 std::unique_ptr<FocusCycler> focus_cycler_; | 251 std::unique_ptr<FocusCycler> focus_cycler_; |
| 252 std::unique_ptr<KeyboardBrightnessControlDelegate> |
| 253 keyboard_brightness_control_delegate_; |
244 std::unique_ptr<KeyboardUI> keyboard_ui_; | 254 std::unique_ptr<KeyboardUI> keyboard_ui_; |
245 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; | 255 std::unique_ptr<MaximizeModeController> maximize_mode_controller_; |
246 std::unique_ptr<MediaDelegate> media_delegate_; | 256 std::unique_ptr<MediaDelegate> media_delegate_; |
247 std::unique_ptr<MruWindowTracker> mru_window_tracker_; | 257 std::unique_ptr<MruWindowTracker> mru_window_tracker_; |
248 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 258 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
249 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 259 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
250 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 260 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
251 | 261 |
252 bool simulate_modal_window_open_for_testing_ = false; | 262 bool simulate_modal_window_open_for_testing_ = false; |
253 | 263 |
254 #if defined(OS_CHROMEOS) | 264 #if defined(OS_CHROMEOS) |
255 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 265 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
256 #endif | 266 #endif |
257 }; | 267 }; |
258 | 268 |
259 } // namespace ash | 269 } // namespace ash |
260 | 270 |
261 #endif // ASH_COMMON_WM_SHELL_H_ | 271 #endif // ASH_COMMON_WM_SHELL_H_ |
OLD | NEW |