| 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 | 14 |
| 15 namespace gfx { | 15 namespace gfx { |
| 16 class Rect; | 16 class Rect; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 | 20 |
| 21 class AccessibilityDelegate; | 21 class AccessibilityDelegate; |
| 22 class MruWindowTracker; | 22 class MruWindowTracker; |
| 23 class SessionStateDelegate; | 23 class SessionStateDelegate; |
| 24 class ShellObserver; | 24 class ShellObserver; |
| 25 class SystemTrayDelegate; | 25 class SystemTrayDelegate; |
| 26 class WindowResizer; | 26 class WindowResizer; |
| 27 class WmActivationObserver; | 27 class WmActivationObserver; |
| 28 class WmDisplayObserver; | 28 class WmDisplayObserver; |
| 29 class WmSystemTrayNotifier; |
| 29 class WmWindow; | 30 class WmWindow; |
| 30 | 31 |
| 31 namespace wm { | 32 namespace wm { |
| 32 | 33 |
| 33 class WindowState; | 34 class WindowState; |
| 34 | 35 |
| 35 enum class WmUserMetricsAction; | 36 enum class WmUserMetricsAction; |
| 36 } | 37 } |
| 37 | 38 |
| 38 // Similar to ash::Shell. Eventually the two will be merged. | 39 // Similar to ash::Shell. Eventually the two will be merged. |
| 39 class ASH_EXPORT WmShell { | 40 class ASH_EXPORT WmShell { |
| 40 public: | 41 public: |
| 41 // This is necessary for a handful of places that is difficult to plumb | 42 // This is necessary for a handful of places that is difficult to plumb |
| 42 // through context. | 43 // through context. |
| 43 static void Set(WmShell* instance); | 44 static void Set(WmShell* instance); |
| 44 static WmShell* Get(); | 45 static WmShell* Get(); |
| 45 static bool HasInstance() { return instance_ != nullptr; } | 46 static bool HasInstance() { return instance_ != nullptr; } |
| 46 | 47 |
| 48 WmSystemTrayNotifier* system_tray_notifier() { |
| 49 return system_tray_notifier_.get(); |
| 50 } |
| 51 |
| 47 SystemTrayDelegate* system_tray_delegate() { | 52 SystemTrayDelegate* system_tray_delegate() { |
| 48 return system_tray_delegate_.get(); | 53 return system_tray_delegate_.get(); |
| 49 } | 54 } |
| 50 | 55 |
| 51 virtual MruWindowTracker* GetMruWindowTracker() = 0; | 56 virtual MruWindowTracker* GetMruWindowTracker() = 0; |
| 52 | 57 |
| 53 // Creates a new window used as a container of other windows. No painting is | 58 // Creates a new window used as a container of other windows. No painting is |
| 54 // done to the created window. | 59 // done to the created window. |
| 55 virtual WmWindow* NewContainerWindow() = 0; | 60 virtual WmWindow* NewContainerWindow() = 0; |
| 56 | 61 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 130 |
| 126 // If |delegate| is not null, sets and initializes the delegate. If |delegate| | 131 // If |delegate| is not null, sets and initializes the delegate. If |delegate| |
| 127 // is null, shuts down and destroys the delegate. | 132 // is null, shuts down and destroys the delegate. |
| 128 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); | 133 void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate); |
| 129 | 134 |
| 130 private: | 135 private: |
| 131 friend class Shell; | 136 friend class Shell; |
| 132 | 137 |
| 133 static WmShell* instance_; | 138 static WmShell* instance_; |
| 134 | 139 |
| 140 std::unique_ptr<WmSystemTrayNotifier> system_tray_notifier_; |
| 135 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; | 141 std::unique_ptr<SystemTrayDelegate> system_tray_delegate_; |
| 136 }; | 142 }; |
| 137 | 143 |
| 138 } // namespace ash | 144 } // namespace ash |
| 139 | 145 |
| 140 #endif // ASH_COMMON_WM_SHELL_H_ | 146 #endif // ASH_COMMON_WM_SHELL_H_ |
| OLD | NEW |