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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 8745015: Store the "browser autorestarted, last session must be restored" information in a preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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: chrome/browser/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index ac3b17221f11c1a13d66c29c0ce5483b99e7d552..6d7a0935586e4834d8a042767afa0881b46b3f71 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -332,9 +332,12 @@ 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))
+ if (command_line.HasSwitch(switches::kRestoreLastSession) ||
+ pref_service->GetBoolean(prefs::kWasRestarted)) {
pref.type = SessionStartupPref::LAST;
+ }
if (pref.type == SessionStartupPref::LAST &&
IncognitoIsForced(command_line, profile->GetPrefs())) {
// We don't store session information when incognito. If the user has

Powered by Google App Engine
This is Rietveld 408576698