| 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 14369090569c3caaec8898563d78ef620565a143..d88b342dafd08ac45c68e6e102ada73eb6a47740 100644
|
| --- a/chrome/browser/ui/startup/startup_browser_creator.cc
|
| +++ b/chrome/browser/ui/startup/startup_browser_creator.cc
|
| @@ -230,10 +230,16 @@ bool StartupBrowserCreator::WasRestarted() {
|
| SessionStartupPref StartupBrowserCreator::GetSessionStartupPref(
|
| const CommandLine& command_line,
|
| Profile* profile) {
|
| - SessionStartupPref pref = SessionStartupPref::GetStartupPref(profile);
|
| -
|
| - // Session restore should be avoided on the first run.
|
| - if (first_run::IsChromeFirstRun())
|
| + DCHECK(profile);
|
| + PrefService *prefs = profile->GetPrefs();
|
| + SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs);
|
| +
|
| + // The pref has an OS-dependent default value. For the first run only, this
|
| + // default is overridden with SessionStartupPref::DEFAULT so that first run
|
| + // behavior (sync promo, welcome page) is consistently invoked.
|
| + // This applies only if the pref is still at its default and has not been
|
| + // set by the user, managed prefs or policy.
|
| + if (first_run::IsChromeFirstRun() && SessionStartupPref::TypeIsDefault(prefs))
|
| pref.type = SessionStartupPref::DEFAULT;
|
|
|
| if (command_line.HasSwitch(switches::kRestoreLastSession) ||
|
|
|