Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1335)

Unified Diff: ash/common/wm_shell.h

Issue 2058173002: mash: Move SystemTrayDelegate ownership to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/wm_shell.h
diff --git a/ash/common/wm_shell.h b/ash/common/wm_shell.h
index 3a34e364139bc846f97dccab6e4602c15ce4d265..a51c65462634859b58d477ccbd03aa99330f1e34 100644
--- a/ash/common/wm_shell.h
+++ b/ash/common/wm_shell.h
@@ -21,7 +21,9 @@ namespace ash {
class AccessibilityDelegate;
class MruWindowTracker;
class SessionStateDelegate;
+class Shell;
msw 2016/06/10 20:48:10 nit: needed?
class ShellObserver;
+class SystemTrayDelegate;
class WindowResizer;
class WmActivationObserver;
class WmDisplayObserver;
@@ -43,6 +45,10 @@ class ASH_EXPORT WmShell {
static WmShell* Get();
static bool HasInstance() { return instance_ != nullptr; }
+ SystemTrayDelegate* system_tray_delegate() {
+ return system_tray_delegate_.get();
+ }
+
virtual MruWindowTracker* GetMruWindowTracker() = 0;
// Creates a new window used as a container of other windows. No painting is
@@ -115,10 +121,19 @@ class ASH_EXPORT WmShell {
virtual void RemoveShellObserver(ShellObserver* observer) = 0;
protected:
- virtual ~WmShell() {}
+ WmShell();
+ virtual ~WmShell();
+
+ // If |delegate| is not null, sets and initializes the delegate. If |delegate|
+ // is null, shuts down and destroys the delegate.
+ void SetSystemTrayDelegate(std::unique_ptr<SystemTrayDelegate> delegate);
private:
+ friend class Shell;
+
static WmShell* instance_;
+
+ std::unique_ptr<SystemTrayDelegate> system_tray_delegate_;
};
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698