| Index: chrome/browser/prefs/session_startup_pref.cc
|
| diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
|
| index 59e262f99e99a142b0b5976fc3019e25e77b0cb1..34176a9f865623694f1b0082a7630e525be9bd33 100644
|
| --- a/chrome/browser/prefs/session_startup_pref.cc
|
| +++ b/chrome/browser/prefs/session_startup_pref.cc
|
| @@ -15,6 +15,10 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/common/pref_names.h"
|
|
|
| +#ifdef OS_MACOSX
|
| +#include "chrome/browser/ui/cocoa/window_restore_utils.h"
|
| +#endif
|
| +
|
| namespace {
|
|
|
| // For historical reasons the enum and value registered in the prefs don't line
|
| @@ -41,6 +45,12 @@ SessionStartupPref::Type PrefValueToType(int pref_value) {
|
| }
|
| }
|
|
|
| +bool TypeIsDefaultValue(PrefService* prefs) {
|
| + const PrefService::Preference* pref_restore =
|
| + prefs->FindPreference(prefs::kRestoreOnStartup);
|
| + return pref_restore->IsDefaultValue();
|
| +}
|
| +
|
| } // namespace
|
|
|
| // static
|
| @@ -96,6 +106,17 @@ SessionStartupPref SessionStartupPref::GetStartupPref(PrefService* prefs) {
|
| SessionStartupPref pref(
|
| PrefValueToType(prefs->GetInteger(prefs::kRestoreOnStartup)));
|
|
|
| +#ifdef OS_MACOSX
|
| + if (TypeIsDefaultValue(prefs)) {
|
| + // |DEFAULT| really means "Don't restore". The actual default value could
|
| + // change, so explicitly set both.
|
| + if (restore_utils::IsWindowRestoreEnabled())
|
| + pref.type = SessionStartupPref::LAST;
|
| + else
|
| + pref.type = SessionStartupPref::DEFAULT;
|
| + }
|
| +#endif
|
| +
|
| // Always load the urls, even if the pref type isn't URLS. This way the
|
| // preferences panels can show the user their last choice.
|
| const ListValue* url_pref_list = prefs->GetList(
|
|
|