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

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: Build fix (browser_tests). Created 9 years 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/browser.cc ('k') | chrome/browser/ui/browser_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_init.cc
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index b1dd2dbe7f4c90a213a8ffc5f0ef9c656792c901..87c15a1a7219f0eab773c6663bcbbc0b0deac488 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/browser_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698