Commit 66470888 authored by sail@chromium.org's avatar sail@chromium.org

Disable sync promo for Chromium builds

BUG=111985
TEST=


Review URL: http://codereview.chromium.org/9159047

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120009 0039d316-1c4b-4281-b951-d872f2087c98
parent 161bc0d7
......@@ -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"
......@@ -40,8 +41,29 @@ 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 SyncPromoUI::VERSION_DEFAULT:
*type = LAYOUT_EXPERIMENT_DEFAULT;
return true;
case SyncPromoUI::VERSION_DEVICES:
*type = LAYOUT_EXPERIMENT_DEVICES;
return true;
case SyncPromoUI::VERSION_VERBOSE:
*type = LAYOUT_EXPERIMENT_VERBOSE;
return true;
case SyncPromoUI::VERSION_SIMPLE:
*type = LAYOUT_EXPERIMENT_SIMPLE;
return true;
case SyncPromoUI::VERSION_DIALOG:
*type = LAYOUT_EXPERIMENT_DIALOG;
return true;
default:
return false;
}
}
if (chrome::VersionInfo::GetChannel() ==
chrome::VersionInfo::CHANNEL_STABLE) {
......@@ -86,10 +108,11 @@ 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 6 groups
// with each group having an equal chance of enrollment.
scoped_refptr<base::FieldTrial> trial(new base::FieldTrial(
kLayoutExperimentTrialName, 5, "default", 2012, 8, 1));
kLayoutExperimentTrialName, 6, "default", 2012, 8, 1));
if (base::FieldTrialList::IsOneTimeRandomizationEnabled())
trial->UseOneTimeRandomization();
trial->AppendGroup("", 1);
......@@ -97,6 +120,7 @@ void Activate() {
trial->AppendGroup("", 1);
trial->AppendGroup("", 1);
trial->AppendGroup("", 1);
#endif
}
}
......
......@@ -5,7 +5,6 @@
#include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
#include "base/command_line.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/first_run/first_run.h"
......@@ -219,8 +218,12 @@ bool SyncPromoUI::ShouldShowSyncPromoAtStartup(Profile* profile,
if (!AllowPromoAtStartupForCurrentBrand())
return false;
// Default to show the promo.
// Default to show the promo for Google Chrome builds.
#if defined(GOOGLE_CHROME_BUILD)
return true;
#else
return false;
#endif
}
void SyncPromoUI::DidShowSyncPromoAtStartup(Profile* profile) {
......@@ -296,13 +299,6 @@ bool SyncPromoUI::UserHasSeenSyncPromoAtStartup(Profile* profile) {
// static
SyncPromoUI::Version SyncPromoUI::GetSyncPromoVersion() {
int value = 0;
if (base::StringToInt(CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kSyncPromoVersion), &value)) {
if (value >= VERSION_DEFAULT && value < VERSION_COUNT)
return static_cast<Version>(value);
}
Version version;
if (sync_promo_trial::GetSyncPromoVersionForCurrentTrial(&version))
return version;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment