diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 23:24:45 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-25 23:24:45 +0000 |
commit | bfd15299e79b8809e05a9fb20dc8cc7dd839ca6e (patch) | |
tree | b20874e33c0b54d538d65c4744620bf155e77953 /chrome/browser/first_run | |
parent | 3b33d16000bc6cd51d3934adb67ebeab4c546090 (diff) | |
download | chromium_src-bfd15299e79b8809e05a9fb20dc8cc7dd839ca6e.zip chromium_src-bfd15299e79b8809e05a9fb20dc8cc7dd839ca6e.tar.gz chromium_src-bfd15299e79b8809e05a9fb20dc8cc7dd839ca6e.tar.bz2 |
mac: Correctly set the default rlz ping delay, allow having a per-user master prefs file.
The code that sets the initial rlz ping delay to 90 wasn't called on mac. Call it.
On windows, master prefs are next to the chrome binary, so for user
chrome installs, the master prefs can be per user. On mac, that's currently
not supported, so allow
"~/Library/Application Support/Google/Chrome/Google Chrome Master Preferences"
in addition to the system master prefs path.
BUG=93421,125030
TEST=Do an official build, add a printf for
master_prefs_->ping_delay in chrome_browser_main.
Verify it prints 90. Put
{
"distribution" : {
"ping_delay": 40
}
}
in master prefs file, relaunch, verify it prints 40.
Review URL: https://chromiumcodereview.appspot.com/10226007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134009 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r-- | chrome/browser/first_run/first_run.cc | 10 | ||||
-rw-r--r-- | chrome/browser/first_run/first_run_internal.h | 4 | ||||
-rw-r--r-- | chrome/browser/first_run/first_run_posix.cc | 2 | ||||
-rw-r--r-- | chrome/browser/first_run/first_run_win.cc | 14 |
4 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 1793846..0387368 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -275,6 +275,16 @@ bool SkipFirstRunUI(installer::MasterPreferences* install_prefs) { &value) || !value); } +void SetRLZPref(first_run::MasterPrefs* out_prefs, + installer::MasterPreferences* install_prefs) { + if (!install_prefs->GetInt(installer::master_preferences::kDistroPingDelay, + &out_prefs->ping_delay)) { + // Default value in case master preferences is missing or corrupt, + // or ping_delay is missing. + out_prefs->ping_delay = 90; + } +} + // -- Platform-specific functions -- #if !defined(OS_LINUX) && !defined(OS_BSD) diff --git a/chrome/browser/first_run/first_run_internal.h b/chrome/browser/first_run/first_run_internal.h index 098a969..610a516 100644 --- a/chrome/browser/first_run/first_run_internal.h +++ b/chrome/browser/first_run/first_run_internal.h @@ -66,6 +66,10 @@ void SetDefaultBrowser(installer::MasterPreferences* install_prefs); // Returns true if the first-run-ui process should be skipped. bool SkipFirstRunUI(installer::MasterPreferences* install_prefs); +// Sets ping_delay. +void SetRLZPref(first_run::MasterPrefs* out_prefs, + installer::MasterPreferences* install_prefs); + // -- Platform-specific functions -- // Gives the full path to the sentinel file. The file might not exist. diff --git a/chrome/browser/first_run/first_run_posix.cc b/chrome/browser/first_run/first_run_posix.cc index db09bd9..f058e25 100644 --- a/chrome/browser/first_run/first_run_posix.cc +++ b/chrome/browser/first_run/first_run_posix.cc @@ -139,6 +139,8 @@ bool ProcessMasterPreferences(const FilePath& user_data_dir, out_prefs->new_tabs = install_prefs->GetFirstRunTabs(); + internal::SetRLZPref(out_prefs, install_prefs.get()); + if (!internal::CopyPrefFile(user_data_dir, master_prefs_path)) return true; diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc index 23322a2..bd3aafe 100644 --- a/chrome/browser/first_run/first_run_win.cc +++ b/chrome/browser/first_run/first_run_win.cc @@ -231,18 +231,6 @@ void DoDelayedInstallExtensionsIfNeeded( } } -void SetRLZPref(first_run::MasterPrefs* out_prefs, - installer::MasterPreferences* install_prefs) { - // RLZ is currently a Windows-only phenomenon. When it comes to the Mac/ - // Linux, enable it here. - if (!install_prefs->GetInt(installer::master_preferences::kDistroPingDelay, - &out_prefs->ping_delay)) { - // 90 seconds is the default that we want to use in case master - // preferences is missing, corrupt or ping_delay is missing. - out_prefs->ping_delay = 90; - } -} - // This class is used by first_run::ImportSettings to determine when the import // process has ended and what was the result of the operation as reported by // the process exit code. This class executes in the context of the main chrome @@ -575,7 +563,7 @@ bool ProcessMasterPreferences(const FilePath& user_data_dir, out_prefs->new_tabs = install_prefs->GetFirstRunTabs(); - SetRLZPref(out_prefs, install_prefs.get()); + internal::SetRLZPref(out_prefs, install_prefs.get()); ShowPostInstallEULAIfNeeded(install_prefs.get()); if (!internal::CopyPrefFile(user_data_dir, master_prefs_path)) |