Chromium Code Reviews| 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..8bf4dd93294ff8b869e677c2d24c72983a22d5ce 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,15 @@ SessionStartupPref SessionStartupPref::GetStartupPref(PrefService* prefs) { |
| SessionStartupPref pref( |
| PrefValueToType(prefs->GetInteger(prefs::kRestoreOnStartup))); |
| +#ifdef OS_MACOSX |
| + if (TypeIsDefaultValue(prefs)) { |
| + if (restore_utils::IsWindowRestoreEnabled()) |
| + pref.type = SessionStartupPref::LAST; |
| + else |
| + pref.type = SessionStartupPref::DEFAULT; |
|
Robert Sesek
2011/07/28 20:08:38
WHy do you need to do this? Won't pref.type still
dhollowa
2011/07/28 20:13:26
This is a bit confusing. DEFAULT really means "do
Robert Sesek
2011/07/28 20:14:07
Makes sense. Leave a comment for the next guy?
dhollowa
2011/07/28 20:18:48
Done.
|
| + } |
| +#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( |