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(); |
+} |