| 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 ash { | 20 namespace ash { |
| 21 | 21 |
| 22 class AccessibilityDelegate; | 22 class AccessibilityDelegate; |
| 23 class FocusCycler; |
| 23 class MruWindowTracker; | 24 class MruWindowTracker; |
| 24 class SessionStateDelegate; | 25 class SessionStateDelegate; |
| 25 class ShellObserver; | 26 class ShellObserver; |
| 26 class SystemTrayDelegate; | 27 class SystemTrayDelegate; |
| 27 class WindowResizer; | 28 class WindowResizer; |
| 28 class WmActivationObserver; | 29 class WmActivationObserver; |
| 29 class WmDisplayObserver; | 30 class WmDisplayObserver; |
| 30 class WmSystemTrayNotifier; | 31 class WmSystemTrayNotifier; |
| 31 class WmWindow; | 32 class WmWindow; |
| 32 | 33 |
| 33 namespace wm { | 34 namespace wm { |
| 34 class WindowState; | 35 class WindowState; |
| 35 } | 36 } |
| 36 | 37 |
| 37 // Similar to ash::Shell. Eventually the two will be merged. | 38 // Similar to ash::Shell. Eventually the two will be merged. |
| 38 class ASH_EXPORT WmShell { | 39 class ASH_EXPORT WmShell { |
| 39 public: | 40 public: |
| 40 // This is necessary for a handful of places that is difficult to plumb | 41 // This is necessary for a handful of places that is difficult to plumb |
| 41 // through context. | 42 // through context. |
| 42 static void Set(WmShell* instance); | 43 static void Set(WmShell* instance); |
| 43 static WmShell* Get(); | 44 static WmShell* Get(); |
| 44 static bool HasInstance() { return instance_ != nullptr; } | 45 static bool HasInstance() { return instance_ != nullptr; } |
| 45 | 46 |
| 47 FocusCycler* focus_cycler() { return focus_cycler_.get(); } |
| 48 |
| 46 WmSystemTrayNotifier* system_tray_notifier() { | 49 WmSystemTrayNotifier* system_tray_notifier() { |
| 47 return system_tray_notifier_.get(); | 50 return system_tray_notifier_.get(); |
| 48 } | 51 } |
| 49 | 52 |
| 50 SystemTrayDelegate* system_tray_delegate() { | 53 SystemTrayDelegate* system_tray_delegate() { |
| 51 return system_tray_delegate_.get(); | 54 return system_tray_delegate_.get(); |
| 52 } | 55 } |
| 53 | 56 |
| 54 virtual MruWindowTracker* GetMruWindowTracker() = 0; | 57 virtual MruWindowTracker* GetMruWindowTracker() = 0; |
| 55 | 58 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 136 |
| 134 // If |delegate| is not null, sets and initializes the delegate. If |delegate| | 137 // If |delegate| is not null, sets and initializes the delegate. If |delegate| |
| 135 // is null, shuts down and destroys the delegate. | 138 // is null, shuts down and destroys the delegate. |
| 136 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 139 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 137 | 140 |
| 138 private: | 141 private: |
| 139 friend class Shell; | 142 friend class Shell; |
| 140 | 143 |
| 141 static WmShell* instance_; | 144 static WmShell* instance_; |
| 142 | 145 |
| 146 std::unique_ptr<FocusCycler> focus_cycler_; |
| 143 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; | 147 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; |
| 144 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 148 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 145 }; | 149 }; |
| 146 | 150 |
| 147 } // namespace ash | 151 } // namespace ash |
| 148 | 152 |
| 149 #endif // ASH_COMMON_WM_SHELL_H_ | 153 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |