| 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/metrics/user_metrics_action.h" | 14 #include "ash/common/metrics/user_metrics_action.h" |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class Rect; | 17 class Rect; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 class PointerWatcher; | 21 class PointerWatcher; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ash { | 24 namespace ash { |
| 25 | 25 |
| 26 class AccessibilityDelegate; | 26 class AccessibilityDelegate; |
| 27 class DisplayInfo; | 27 class DisplayInfo; |
| 28 class FocusCycler; | 28 class FocusCycler; |
| 29 class KeyboardUI; |
| 29 class MruWindowTracker; | 30 class MruWindowTracker; |
| 30 class SessionStateDelegate; | 31 class SessionStateDelegate; |
| 31 class ShellObserver; | 32 class ShellObserver; |
| 32 class SystemTrayDelegate; | 33 class SystemTrayDelegate; |
| 33 class SystemTrayNotifier; | 34 class SystemTrayNotifier; |
| 34 class WindowResizer; | 35 class WindowResizer; |
| 35 class WindowSelectorController; | 36 class WindowSelectorController; |
| 36 class WmActivationObserver; | 37 class WmActivationObserver; |
| 37 class WmDisplayObserver; | 38 class WmDisplayObserver; |
| 38 class WmRootWindowController; | 39 class WmRootWindowController; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 51 class ASH_EXPORT WmShell { | 52 class ASH_EXPORT WmShell { |
| 52 public: | 53 public: |
| 53 // This is necessary for a handful of places that is difficult to plumb | 54 // This is necessary for a handful of places that is difficult to plumb |
| 54 // through context. | 55 // through context. |
| 55 static void Set(WmShell* instance); | 56 static void Set(WmShell* instance); |
| 56 static WmShell* Get(); | 57 static WmShell* Get(); |
| 57 static bool HasInstance() { return instance_ != nullptr; } | 58 static bool HasInstance() { return instance_ != nullptr; } |
| 58 | 59 |
| 59 FocusCycler* focus_cycler() { return focus_cycler_.get(); } | 60 FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
| 60 | 61 |
| 62 KeyboardUI* keyboard_ui() { return keyboard_ui_.get(); } |
| 63 |
| 61 SystemTrayNotifier* system_tray_notifier() { | 64 SystemTrayNotifier* system_tray_notifier() { |
| 62 return system_tray_notifier_.get(); | 65 return system_tray_notifier_.get(); |
| 63 } | 66 } |
| 64 | 67 |
| 65 SystemTrayDelegate* system_tray_delegate() { | 68 SystemTrayDelegate* system_tray_delegate() { |
| 66 return system_tray_delegate_.get(); | 69 return system_tray_delegate_.get(); |
| 67 } | 70 } |
| 68 | 71 |
| 69 WindowSelectorController* window_selector_controller() { | 72 WindowSelectorController* window_selector_controller() { |
| 70 return window_selector_controller_.get(); | 73 return window_selector_controller_.get(); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 174 } |
| 172 | 175 |
| 173 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. | 176 // TODO(jamescook): Remove this when VirtualKeyboardController has been moved. |
| 174 virtual void ToggleIgnoreExternalKeyboard() = 0; | 177 virtual void ToggleIgnoreExternalKeyboard() = 0; |
| 175 #endif | 178 #endif |
| 176 | 179 |
| 177 protected: | 180 protected: |
| 178 WmShell(); | 181 WmShell(); |
| 179 virtual ~WmShell(); | 182 virtual ~WmShell(); |
| 180 | 183 |
| 184 void SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui); |
| 185 |
| 181 // Sets and initializes the |delegate|. | 186 // Sets and initializes the |delegate|. |
| 182 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 187 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 183 void DeleteSystemTrayDelegate(); | 188 void DeleteSystemTrayDelegate(); |
| 184 | 189 |
| 185 void DeleteWindowSelectorController(); | 190 void DeleteWindowSelectorController(); |
| 186 | 191 |
| 187 private: | 192 private: |
| 188 friend class Shell; | 193 friend class Shell; |
| 189 | 194 |
| 190 static WmShell* instance_; | 195 static WmShell* instance_; |
| 191 | 196 |
| 192 std::unique_ptr<FocusCycler> focus_cycler_; | 197 std::unique_ptr<FocusCycler> focus_cycler_; |
| 198 std::unique_ptr<KeyboardUI> keyboard_ui_; |
| 193 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; | 199 std::unique_ptr<SystemTrayNotifier> system_tray_notifier_; |
| 194 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 200 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 195 std::unique_ptr<WindowSelectorController> window_selector_controller_; | 201 std::unique_ptr<WindowSelectorController> window_selector_controller_; |
| 196 | 202 |
| 197 bool simulate_modal_window_open_for_testing_ = false; | 203 bool simulate_modal_window_open_for_testing_ = false; |
| 198 | 204 |
| 199 #if defined(OS_CHROMEOS) | 205 #if defined(OS_CHROMEOS) |
| 200 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; | 206 std::unique_ptr<LogoutConfirmationController> logout_confirmation_controller_; |
| 201 #endif | 207 #endif |
| 202 }; | 208 }; |
| 203 | 209 |
| 204 } // namespace ash | 210 } // namespace ash |
| 205 | 211 |
| 206 #endif // ASH_COMMON_WM_SHELL_H_ | 212 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |