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

Unified Diff: ash/common/wm_shell.cc

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.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 2161121c8fda5a8f5b2b6ad92e22b747eed071e3..def0eb526616efd17fdd96e1cf4fc8a8aa4c4305 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -4,6 +4,9 @@
#include "ash/common/wm_shell.h"
+#include "ash/common/system/tray/system_tray_delegate.h"
+#include "base/logging.h"
+
namespace ash {
// static
@@ -19,4 +22,22 @@ WmShell* WmShell::Get() {
return instance_;
}
+WmShell::WmShell() {}
+
+WmShell::~WmShell() {}
+
+void WmShell::SetSystemTrayDelegate(
+ std::unique_ptr<SystemTrayDelegate> delegate) {
+ if (delegate) {
+ DCHECK(!system_tray_delegate_);
+ // TODO(jamescook): Create via ShellDelegate once it moves to //ash/common.
+ system_tray_delegate_ = std::move(delegate);
+ system_tray_delegate_->Initialize();
+ } else {
+ DCHECK(system_tray_delegate_);
+ system_tray_delegate_->Shutdown();
+ system_tray_delegate_.reset();
+ }
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698