Chromium Code Reviews| Index: chrome/browser/chrome_browser_field_trials.cc |
| diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc |
| index 0a0c9a8c8fd5b9a6133edb0de004dbab1364f459..1aa4658ac6a7ae822fc79fceeeb97d6c007e93a4 100644 |
| --- a/chrome/browser/chrome_browser_field_trials.cc |
| +++ b/chrome/browser/chrome_browser_field_trials.cc |
| @@ -6,8 +6,11 @@ |
| #include <string> |
| +#include "apps/field_trial_names.h" |
| +#include "apps/pref_names.h" |
| #include "base/command_line.h" |
| #include "base/metrics/field_trial.h" |
| +#include "base/prefs/pref_service.h" |
| #include "base/string_util.h" |
| #include "base/stringprintf.h" |
| #include "base/strings/string_number_conversions.h" |
| @@ -26,6 +29,7 @@ |
| #include "chrome/common/chrome_version_info.h" |
| #include "chrome/common/metrics/variations/uniformity_field_trials.h" |
| #include "chrome/common/metrics/variations/variations_util.h" |
| +#include "chrome/common/pref_names.h" |
| #include "net/socket/client_socket_pool_base.h" |
| #include "net/spdy/spdy_session.h" |
| #include "ui/base/layout.h" |
| @@ -56,13 +60,21 @@ ChromeBrowserFieldTrials::ChromeBrowserFieldTrials( |
| ChromeBrowserFieldTrials::~ChromeBrowserFieldTrials() { |
| } |
| -void ChromeBrowserFieldTrials::SetupFieldTrials( |
| - const base::Time& install_time) { |
| +void ChromeBrowserFieldTrials::SetupFieldTrials(PrefService* local_state) { |
| + const base::Time install_time = base::Time::FromTimeT( |
| + local_state->GetInt64(prefs::kInstallDate)); |
| + DCHECK(!install_time.is_null()); |
| chrome_variations::SetupUniformityFieldTrials(install_time); |
| SetUpSimpleCacheFieldTrial(); |
| #if !defined(OS_ANDROID) |
| SetupDesktopFieldTrials(); |
| #endif // defined(OS_ANDROID) |
| + // This is not quite a field trial initialization, but it's an initialization |
| + // that depends on a field trial, so why not? :-) |
| + if (base::FieldTrialList::FindFullName(apps::kLauncherPromoTrialName) == |
|
Alexei Svitkine (slow)
2013/03/22 16:57:35
Please encapsulate this in a separate function and
MAD
2013/03/22 17:11:35
Done.
|
| + apps::kResetShowLauncherPromoPrefGroup) { |
| + local_state->SetBoolean(apps::prefs::kShowAppLauncherPromo, true); |
| + } |
| } |
| void ChromeBrowserFieldTrials::SetupDesktopFieldTrials() { |