diff options
Diffstat (limited to 'chrome/browser/prerender/prerender_field_trial.cc')
-rw-r--r-- | chrome/browser/prerender/prerender_field_trial.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/prerender/prerender_field_trial.cc b/chrome/browser/prerender/prerender_field_trial.cc index 6ff8c6a..312c9fb 100644 --- a/chrome/browser/prerender/prerender_field_trial.cc +++ b/chrome/browser/prerender/prerender_field_trial.cc @@ -29,6 +29,10 @@ int g_omnibox_trial_default_group_number = kint32min; const char kLocalPredictorTrialName[] = "PrerenderLocalPredictor"; const char kLocalPredictorEnabledGroup[] = "Enabled"; +const char kLoggedInPredictorTrialName[] = "PrerenderLoggedInPredictor"; +const char kLoggedInPredictorEnabledGroup[] = "Enabled"; +const char kLoggedInPredictorDisabledGroup[] = "Disabled"; + void SetupPrefetchFieldTrial() { chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); if (channel == chrome::VersionInfo::CHANNEL_STABLE || @@ -141,6 +145,7 @@ void SetupPrerenderFieldTrial() { } // end namespace void ConfigureOmniboxPrerender(); +void ConfigureLoggedInPredictor(); void ConfigurePrefetchAndPrerender(const CommandLine& command_line) { enum PrerenderOption { @@ -197,6 +202,7 @@ void ConfigurePrefetchAndPrerender(const CommandLine& command_line) { } ConfigureOmniboxPrerender(); + ConfigureLoggedInPredictor(); } void ConfigureOmniboxPrerender() { @@ -217,6 +223,19 @@ void ConfigureOmniboxPrerender() { kDisabledProbability); } +void ConfigureLoggedInPredictor() { + chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); + if (channel == chrome::VersionInfo::CHANNEL_STABLE || + channel == chrome::VersionInfo::CHANNEL_BETA) { + return; + } + scoped_refptr<FieldTrial> logged_in_predictor_trial( + FieldTrialList::FactoryGetFieldTrial( + kLoggedInPredictorTrialName, 100, + kLoggedInPredictorDisabledGroup, 2013, 12, 31, NULL)); + logged_in_predictor_trial->AppendGroup(kLoggedInPredictorEnabledGroup, 100); +} + bool IsOmniboxEnabled(Profile* profile) { if (!profile) return false; @@ -250,4 +269,9 @@ bool IsLocalPredictorEnabled() { kLocalPredictorEnabledGroup; } +bool IsLoggedInPredictorEnabled() { + return base::FieldTrialList::FindFullName(kLoggedInPredictorTrialName) == + kLoggedInPredictorEnabledGroup; +} + } // namespace prerender |