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

Unified Diff: chrome/browser/instant/instant_field_trial.cc

Issue 10254014: Don't do field trials if Instant is explicitly enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/instant/instant_field_trial.cc
diff --git a/chrome/browser/instant/instant_field_trial.cc b/chrome/browser/instant/instant_field_trial.cc
index 0087b8b2a73156a1d457b6073cfb7253cf1df77b..83c60ec92a709eeb04404b8009dbf02efa05cf39 100644
--- a/chrome/browser/instant/instant_field_trial.cc
+++ b/chrome/browser/instant/instant_field_trial.cc
@@ -66,6 +66,11 @@ InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) {
if (group == base::FieldTrial::kNotFinalized || group == g_inactive)
return INACTIVE;
+ // If Instant is already enabled explicitly, then it's not a field trial.
+ const PrefService* prefs = profile ? profile->GetPrefs() : NULL;
+ if (prefs && prefs->GetBoolean(prefs::kInstantEnabled))
+ return INACTIVE;
+
// CONTROL and SILENT are unconstrained.
if (group == g_control)
return CONTROL;
@@ -73,7 +78,6 @@ InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) {
return SILENT;
// HIDDEN, SUGGEST and INSTANT need non-incognito, suggest-enabled profiles.
- const PrefService* prefs = profile ? profile->GetPrefs() : NULL;
if (!prefs || profile->IsOffTheRecord() ||
!prefs->GetBoolean(prefs::kSearchSuggestEnabled)) {
return INACTIVE;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698