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

Unified Diff: ash/common/wm_shell.cc

Issue 2108793002: mash: Convert system tray logout button to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments, fix windows 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
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 4aa534e580fcae74d6ff84b133f6cdcfbf9defcb..89170590799b781dbc5eff5cf3f1300ccdccabd5 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -6,10 +6,12 @@
#include "ash/common/focus_cycler.h"
#include "ash/common/shell_window_ids.h"
+#include "ash/common/system/chromeos/session/logout_confirmation_controller.h"
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/wm/overview/window_selector_controller.h"
#include "ash/common/wm_window.h"
+#include "base/bind.h"
#include "base/logging.h"
namespace ash {
@@ -34,6 +36,10 @@ WmShell::WmShell()
WmShell::~WmShell() {}
+WmRootWindowController* WmShell::GetPrimaryRootWindowController() {
+ return GetPrimaryRootWindow()->GetRootWindowController();
+}
+
bool WmShell::IsSystemModalWindowOpen() {
if (simulate_modal_window_open_for_testing_)
return true;
@@ -56,16 +62,24 @@ bool WmShell::IsSystemModalWindowOpen() {
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();
- }
+ DCHECK(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();
+#if defined(OS_CHROMEOS)
+ logout_confirmation_controller_.reset(new LogoutConfirmationController(
+ base::Bind(&SystemTrayDelegate::SignOut,
+ base::Unretained(system_tray_delegate_.get()))));
+#endif
+}
+
+void WmShell::DeleteSystemTrayDelegate() {
+#if defined(OS_CHROMEOS)
+ logout_confirmation_controller_.reset();
+#endif
+ DCHECK(system_tray_delegate_);
msw 2016/06/28 21:09:16 optional nit: DCHECK at top?
James Cook 2016/06/28 21:41:02 Done.
+ system_tray_delegate_.reset();
}
void WmShell::DeleteWindowSelectorController() {
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698