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

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

Issue 7558014: Add a URL param to indicate group selection in Instant field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed @pkasting's comments Created 9 years, 4 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/instant/instant_field_trial.h ('k') | chrome/browser/instant/instant_loader.cc » ('j') | 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 38ee088d11e03d1a6519d644b2eccdb447d3d3b6..65274d96782336b6028cae90f7e9a7634c47c5fd 100644
--- a/chrome/browser/instant/instant_field_trial.cc
+++ b/chrome/browser/instant/instant_field_trial.cc
@@ -38,7 +38,7 @@ void InstantFieldTrial::Activate() {
// static
InstantFieldTrial::Group InstantFieldTrial::GetGroup(Profile* profile) {
- if (profile->IsOffTheRecord())
+ if (!profile || profile->IsOffTheRecord())
return INACTIVE;
const PrefService* prefs = profile->GetPrefs();
@@ -81,3 +81,16 @@ std::string InstantFieldTrial::GetGroupName(Profile* profile) {
NOTREACHED();
return "InstantUnknown";
}
+
+// static
+std::string InstantFieldTrial::GetGroupAsUrlParam(Profile* profile) {
+ switch (GetGroup(profile)) {
+ case INACTIVE: return std::string();
+ case CONTROL1: return "ix=c1&";
+ case CONTROL2: return "ix=c2&";
+ case EXPERIMENT1: return "ix=e1&";
+ case EXPERIMENT2: return "ix=e2&";
+ }
+ NOTREACHED();
+ return std::string();
+}
« no previous file with comments | « chrome/browser/instant/instant_field_trial.h ('k') | chrome/browser/instant/instant_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698