Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: chrome/browser/prerender/prerender_field_trial.cc

Issue 14065014: Add the LoggedIn Predictor, to detect which websites a user is likely (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_field_trial.h ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_field_trial.cc
===================================================================
--- chrome/browser/prerender/prerender_field_trial.cc (revision 194607)
+++ chrome/browser/prerender/prerender_field_trial.cc (working copy)
@@ -29,6 +29,10 @@
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 @@
} // end namespace
void ConfigureOmniboxPrerender();
+void ConfigureLoggedInPredictor();
void ConfigurePrefetchAndPrerender(const CommandLine& command_line) {
enum PrerenderOption {
@@ -197,6 +202,7 @@
}
ConfigureOmniboxPrerender();
+ ConfigureLoggedInPredictor();
}
void ConfigureOmniboxPrerender() {
@@ -217,6 +223,19 @@
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 @@
kLocalPredictorEnabledGroup;
}
+bool IsLoggedInPredictorEnabled() {
+ return base::FieldTrialList::FindFullName(kLoggedInPredictorTrialName) ==
+ kLoggedInPredictorEnabledGroup;
+}
+
} // namespace prerender
« no previous file with comments | « chrome/browser/prerender/prerender_field_trial.h ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698