summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-09 00:31:04 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-09 00:31:04 +0000
commit75a9efb044a5cda8cd05b77d8fe0dcc8d72579a6 (patch)
tree426c097fbeddf2a430415c1b5fc4db31074f8ec2 /chrome/browser/prefs
parent0eccf5645d8b5644775db6a31447fd985ab6b170 (diff)
downloadchromium_src-75a9efb044a5cda8cd05b77d8fe0dcc8d72579a6.zip
chromium_src-75a9efb044a5cda8cd05b77d8fe0dcc8d72579a6.tar.gz
chromium_src-75a9efb044a5cda8cd05b77d8fe0dcc8d72579a6.tar.bz2
Fix sync promo first run bugs
This CL fixes two small bugs with showing the sync promo on first run. First, if a master prefs file specified start URLs (using "first_run_tabs") then the sync promo wouldn't be shown. Fix was to add the sync promo even if the start URLs was non-empty. Second, on Mac OS X, the "On Startup" pref would incorrectly be migrated to "Continue where I left off". This also caused the sync promo to be skipped. The problem was the profile version pref was not set yet which caused the migration code to assume that an old profile was being migrated. Fix was to check that the pref was actually set. BUG=180521 TEST=Created the following master prefs file: { "homepage" : "http://www.chromium.org/", "homepage_is_newtabpage" : false, "first_run_tabs" : [ "new_tab_page", "welcome_page", "http://cnn.com" ] } Placed the file in /Library/Application Support/Chromium/Chromium Master Preferences Verified that the sync promo showed. Review URL: https://chromiumcodereview.appspot.com/12638005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs')
-rw-r--r--chrome/browser/prefs/session_startup_pref.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/prefs/session_startup_pref.cc b/chrome/browser/prefs/session_startup_pref.cc
index 9ce5f44..d822cc0 100644
--- a/chrome/browser/prefs/session_startup_pref.cc
+++ b/chrome/browser/prefs/session_startup_pref.cc
@@ -186,8 +186,11 @@ void SessionStartupPref::MigrateMacDefaultPrefIfNecessary(PrefService* prefs) {
// The default startup pref used to be LAST, now it is DEFAULT. Don't change
// the setting for existing profiles (even if the user has never changed it),
// but make new profiles default to DEFAULT.
- bool old_profile_version = Version(prefs->GetString(
- prefs::kProfileCreatedByVersion)).IsOlderThan("21.0.1180.0");
+ bool old_profile_version =
+ !prefs->FindPreference(
+ prefs::kProfileCreatedByVersion)->IsDefaultValue() &&
+ Version(prefs->GetString(prefs::kProfileCreatedByVersion)).IsOlderThan(
+ "21.0.1180.0");
if (old_profile_version && TypeIsDefault(prefs))
prefs->SetInteger(prefs::kRestoreOnStartup, kPrefValueLast);
#endif