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

Unified Diff: ash/shell.cc

Issue 178183005: Add LogoutConfirmationController to show LogoutConfirmationDialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index c70e584ccb1fe530cf363e4a08de49c36bb75ff8..055b809b70472b823cb98a18ba4fe3f188652072 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -49,6 +49,7 @@
#include "ash/shell_factory.h"
#include "ash/shell_window_ids.h"
#include "ash/system/locale/locale_notification_controller.h"
+#include "ash/system/logout_confirmation/logout_confirmation_controller.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/system_tray_notifier.h"
@@ -80,8 +81,10 @@
#include "ash/wm/window_util.h"
#include "ash/wm/workspace_controller.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/debug/trace_event.h"
+#include "base/time/default_tick_clock.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/user_action_client.h"
#include "ui/aura/env.h"
@@ -655,6 +658,9 @@ Shell::~Shell() {
// TODO(xiyuan): Move it back when app list container is no longer needed.
app_list_controller_.reset();
+ // Destroy the LogoutConfirmationController before the SystemTrayDelegate.
+ logout_confirmation_controller_.reset();
+
// Destroy SystemTrayDelegate before destroying the status area(s).
system_tray_delegate_->Shutdown();
system_tray_delegate_.reset();
@@ -952,6 +958,13 @@ void Shell::Init() {
// Initialize system_tray_delegate_ after StatusAreaWidget is created.
system_tray_delegate_->Initialize();
+ // Create the LogoutConfirmationController after the SystemTrayDelegate.
+ logout_confirmation_controller_.reset(
+ new internal::LogoutConfirmationController(
+ scoped_ptr<base::TickClock>(new base::DefaultTickClock),
stevenjb 2014/02/27 17:58:44 nit: use make_scoped_ptr?
bartfab (slow) 2014/02/28 12:13:49 make_scoped_ptr cannot be used when upcasting, as
stevenjb 2014/03/04 23:33:29 Ah, I missed the upcast. I like this version bette
+ base::Bind(&SystemTrayDelegate::SignOut,
+ base::Unretained(system_tray_delegate_.get()))));
stevenjb 2014/02/27 17:58:44 Even though we are explicitly creating/destroying
bartfab (slow) 2014/02/28 12:13:49 The reason for doing it this way is that I can sup
stevenjb 2014/03/04 23:33:29 Testability is important, but stability even more
bartfab (slow) 2014/03/05 18:19:44 Added a comment.
+
// TODO(oshima): Initialize all RootWindowControllers once, and
// initialize controller/delegates above when initializing the
// primary root window controller.

Powered by Google App Engine
This is Rietveld 408576698