From bfd15299e79b8809e05a9fb20dc8cc7dd839ca6e Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Wed, 25 Apr 2012 23:24:45 +0000 Subject: 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 --- chrome/browser/first_run/first_run.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'chrome/browser/first_run/first_run.cc') 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) -- cgit v1.1