Chromium Code Reviews| Index: chrome/browser/ui/browser_list.cc |
| diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc |
| index 9b48e9607891b18451c34171dfdde98f27b36d0b..8464d0dfbbd6f0621bac45e04a971d0b14ebcf06 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 |
| @@ -518,29 +520,28 @@ void BrowserList::AttemptRestart() { |
| (*it)->profile()->SaveSessionState(); |
| } |
| } |
| - |
|
Finnur
2011/11/30 18:32:04
nit: shouldn't we keep this line break?
nit: can y
marja
2011/12/02 09:23:41
Done. Braces removed in the not-yet-committed CL (
|
| #if defined(OS_CHROMEOS) |
| // 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) |