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/ui/webui/sync_promo/sync_promo_trial.cc

Issue 9159047: Disable sync promo for Chromium builds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: a Created 8 years, 11 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
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
}
}

Powered by Google App Engine
This is Rietveld 408576698