| Index: chrome/browser/ui/browser_init.cc
|
| diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
|
| index e4384e86add0063323017b117518a13fb689e297..ccd664d4c9e153dd85b62f2f6e26fabd728c8c7f 100644
|
| --- a/chrome/browser/ui/browser_init.cc
|
| +++ b/chrome/browser/ui/browser_init.cc
|
| @@ -334,10 +334,9 @@ bool IncognitoIsForced(const CommandLine& command_line,
|
|
|
| SessionStartupPref GetSessionStartupPref(const CommandLine& command_line,
|
| Profile* profile) {
|
| - PrefService* pref_service = g_browser_process->local_state();
|
| SessionStartupPref pref = SessionStartupPref::GetStartupPref(profile);
|
| if (command_line.HasSwitch(switches::kRestoreLastSession) ||
|
| - pref_service->GetBoolean(prefs::kWasRestarted)) {
|
| + BrowserInit::was_restarted()) {
|
| pref.type = SessionStartupPref::LAST;
|
| }
|
| if (pref.type == SessionStartupPref::LAST &&
|
| @@ -498,6 +497,9 @@ void RegisterComponentsForUpdate(const CommandLine& command_line) {
|
|
|
| // BrowserInit ----------------------------------------------------------------
|
|
|
| +bool BrowserInit::was_restarted_read_ = false;
|
| +bool BrowserInit::was_restarted_ = false;
|
| +
|
| BrowserInit::BrowserInit() {}
|
|
|
| BrowserInit::~BrowserInit() {}
|
| @@ -584,6 +586,17 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line,
|
| return true;
|
| }
|
|
|
| +// static
|
| +bool BrowserInit::was_restarted() {
|
| + if (!was_restarted_read_) {
|
| + PrefService* pref_service = g_browser_process->local_state();
|
| + was_restarted_ = pref_service->GetBoolean(prefs::kWasRestarted);
|
| + pref_service->SetBoolean(prefs::kWasRestarted, false);
|
| + pref_service->ScheduleSavePersistentPrefs();
|
| + was_restarted_read_ = true;
|
| + }
|
| + return was_restarted_;
|
| +}
|
|
|
| // BrowserInit::LaunchWithProfile::Tab ----------------------------------------
|
|
|
|
|