Index: chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc |
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc |
index e00caf52a29206d1585b99b5099e610386568fca..d1858193ce5d3cb8e23bf83469f1c7dcb221c7d5 100644 |
--- a/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc |
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_trial.cc |
@@ -6,6 +6,7 @@ |
#include "base/command_line.h" |
#include "base/metrics/field_trial.h" |
+#include "base/string_number_conversions.h" |
#include "base/string_util.h" |
#include "chrome/browser/google/google_util.h" |
#include "chrome/browser/metrics/metrics_service.h" |
@@ -39,8 +40,26 @@ bool sync_promo_trial_initialized; |
bool GetActiveLayoutExperiment(LayoutExperimentType* type) { |
DCHECK(type); |
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSyncPromoVersion)) |
- return false; |
+ int version = 0; |
+ if (base::StringToInt(CommandLine::ForCurrentProcess()-> |
+ GetSwitchValueASCII(switches::kSyncPromoVersion), &version)) { |
+ switch (version) { |
+ case 0: |
+ *type = LAYOUT_EXPERIMENT_DEFAULT; |
+ return true; |
+ case 1: |
+ *type = LAYOUT_EXPERIMENT_DEVICES; |
+ return true; |
+ case 2: |
+ *type = LAYOUT_EXPERIMENT_VERBOSE; |
+ return true; |
+ case 3: |
+ *type = LAYOUT_EXPERIMENT_SIMPLE; |
+ return true; |
+ default: |
+ return false; |
+ } |
+ } |
if (chrome::VersionInfo::GetChannel() == |
chrome::VersionInfo::CHANNEL_STABLE) { |
@@ -83,6 +102,7 @@ void Activate() { |
// For dev and beta we don't have brand codes so we randomly enroll users. |
if (chrome::VersionInfo::GetChannel() != |
chrome::VersionInfo::CHANNEL_STABLE) { |
+#if defined(GOOGLE_CHROME_BUILD) |
// Create a field trial that expires in August 8, 2012. It contains 5 groups |
// with each group having an equal chance of enrollment. |
scoped_refptr<base::FieldTrial> trial(new base::FieldTrial( |
@@ -93,6 +113,7 @@ void Activate() { |
trial->AppendGroup("", 1); |
trial->AppendGroup("", 1); |
trial->AppendGroup("", 1); |
+#endif |
} |
} |