Index: chrome/browser/ui/browser_list.cc |
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc |
index 3ce3e514977fe7c12975d2d54f620dfebc2dfbf1..8c7fd14dad6b87e0c2cdbb5fcf3f33e29e4b52f6 100644 |
--- a/chrome/browser/ui/browser_list.cc |
+++ b/chrome/browser/ui/browser_list.cc |
@@ -302,7 +302,9 @@ void BrowserList::MarkAsCleanShutdown() { |
} |
} |
-void BrowserList::AttemptExitInternal() { |
+void BrowserList::AttemptExitInternal(bool restart) { |
+ PrefService* pref_service = g_browser_process->local_state(); |
+ pref_service->SetBoolean(prefs::kWasRestarted, restart); |
content::NotificationService::current()->Notify( |
content::NOTIFICATION_APP_EXITING, |
content::NotificationService::AllSources(), |
@@ -479,7 +481,7 @@ void BrowserList::CloseAllBrowsersWithProfile(Profile* profile) { |
} |
// static |
-void BrowserList::AttemptUserExit() { |
+void BrowserList::AttemptUserExit(bool restart) { |
#if defined(OS_CHROMEOS) |
chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); |
// Write /tmp/uptime-logout-started as well. |
@@ -506,7 +508,7 @@ void BrowserList::AttemptUserExit() { |
PrefService* pref_service = g_browser_process->local_state(); |
pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, false); |
#endif |
- AttemptExitInternal(); |
+ AttemptExitInternal(restart); |
} |
// static |
@@ -522,24 +524,24 @@ void BrowserList::AttemptRestart() { |
// For CrOS instead of browser restart (which is not supported) perform a full |
// sign out. Session will be only restored if user has that setting set. |
// Same session restore behavior happens in case of full restart after update. |
- AttemptUserExit(); |
+ AttemptUserExit(true); |
#else |
// Set the flag to restore state after the restart. |
PrefService* pref_service = g_browser_process->local_state(); |
pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true); |
- AttemptExit(); |
+ AttemptExit(true); |
#endif |
} |
// static |
-void BrowserList::AttemptExit() { |
+void BrowserList::AttemptExit(bool restart) { |
// If we know that all browsers can be closed without blocking, |
// don't notify users of crashes beyond this point. |
// Note that MarkAsCleanShutdown does not set UMA's exit cleanly bit |
// so crashes during shutdown are still reported in UMA. |
if (AreAllBrowsersCloseable()) |
MarkAsCleanShutdown(); |
- AttemptExitInternal(); |
+ AttemptExitInternal(restart); |
} |
#if defined(OS_CHROMEOS) |