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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 653773003: Fixing problem where a session restore gets performed even though users don't want it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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/sessions/session_restore_browsertest_chromeos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/startup_browser_creator.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index 20f8ceacbc74547c6f0362231cbd9500af1882bd..4d0c135c38c75716c753e4dd71eda7f4d884ae2e 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -362,8 +362,11 @@ SessionStartupPref StartupBrowserCreator::GetSessionStartupPref(
#if defined(OS_CHROMEOS)
const bool is_first_run =
user_manager::UserManager::Get()->IsCurrentUserNew();
+ // A controlled restart on ChromeOS should respect the session restore state.
+ const bool did_restart = false;
sky 2014/10/15 23:57:20 Won't this mean if you change an about:flag and cl
sky 2014/10/16 20:35:27 This comment is confusing. I think you mean someth
Mr4D (OOO till 08-26) 2014/10/16 20:58:43 Done.
#else
const bool is_first_run = first_run::IsChromeFirstRun();
+ const bool did_restart = StartupBrowserCreator::WasRestarted();
#endif
// The pref has an OS-dependent default value. For the first run only, this
@@ -379,8 +382,7 @@ SessionStartupPref StartupBrowserCreator::GetSessionStartupPref(
// However, new profiles can be created from a browser process that has this
// switch so do not set the session pref to SessionStartupPref::LAST for
// those as there is nothing to restore.
- if ((command_line.HasSwitch(switches::kRestoreLastSession) ||
- StartupBrowserCreator::WasRestarted()) &&
+ if ((command_line.HasSwitch(switches::kRestoreLastSession) || did_restart) &&
!profile->IsNewProfile()) {
pref.type = SessionStartupPref::LAST;
}
« no previous file with comments | « chrome/browser/sessions/session_restore_browsertest_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698