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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc

Issue 210673002: Revert of Delete "shutdown without closing browsers" path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
index cedcf3a8cdb6c0c1ae4fd05f32e8a89dfab2c6f2..39ba0d31c3fd30803a780476aaadf1def9821eea 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
@@ -35,6 +35,8 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
+#include "chromeos/dbus/dbus_thread_manager.h"
+#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/ime/input_method_manager.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/user_metrics.h"
@@ -235,8 +237,10 @@
new chromeos::DisplayConfigurationObserver());
}
-void ChromeShellDelegate::PreShutdown() {
- display_configuration_observer_.reset();
+void ChromeShellDelegate::Shutdown() {
+ content::RecordAction(base::UserMetricsAction("Shutdown"));
+ chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->
+ RequestShutdown();
}
ash::SessionStateDelegate* ChromeShellDelegate::CreateSessionStateDelegate() {
@@ -281,6 +285,11 @@
InitAfterSessionStart();
ash::Shell::GetInstance()->ShowShelf();
break;
+ case chrome::NOTIFICATION_APP_TERMINATING:
+ // Let classes unregister themselves as observers of the
+ // ash::Shell singleton before the shell is destroyed.
+ display_configuration_observer_.reset();
+ break;
default:
NOTREACHED() << "Unexpected notification " << type;
}
@@ -293,4 +302,7 @@
registrar_.Add(this,
chrome::NOTIFICATION_SESSION_STARTED,
content::NotificationService::AllSources());
-}
+ registrar_.Add(this,
+ chrome::NOTIFICATION_APP_TERMINATING,
+ content::NotificationService::AllSources());
+}
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | chrome/browser/ui/ash/chrome_shell_delegate_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698