summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prerender/prerender_field_trial.cc
diff options
context:
space:
mode:
authortburkard@chromium.org <tburkard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-16 23:33:28 +0000
committertburkard@chromium.org <tburkard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-16 23:33:28 +0000
commitc831a652ec307806bc3a90f4b30942f03960f6e0 (patch)
tree2ed8cd7a84a3b0ea055c5f0ae05e02c25a9d30d8 /chrome/browser/prerender/prerender_field_trial.cc
parentc2f3435e3c74fe127af027528126b06dc11e8d66 (diff)
downloadchromium_src-c831a652ec307806bc3a90f4b30942f03960f6e0.zip
chromium_src-c831a652ec307806bc3a90f4b30942f03960f6e0.tar.gz
chromium_src-c831a652ec307806bc3a90f4b30942f03960f6e0.tar.bz2
Add the LoggedIn Predictor, to detect which websites a user is likely
logged into (or has been logged into). R=shishir@chromium.org, bauerb@chromium.org Review URL: https://codereview.chromium.org/13903018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_field_trial.cc')
-rw-r--r--chrome/browser/prerender/prerender_field_trial.cc24
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