Enable VariationsService on Android.

BUG=224018, 168224
TEST=On a Chrome for Android official build, launch Chrome, quit it and launch it again. Go to chrome://version and verify that the string "5a3c10b5" appears in the Variations list. (This corresponds to the server-controlled Test0PercentDefault field trial).
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/13954011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195407 0039d316-1c4b-4281-b951-d872f2087c98
parent ac0b52ee
......@@ -48,15 +48,19 @@ void ChromeBrowserFieldTrials::SetupFieldTrials(PrefService* local_state) {
const base::Time install_time = base::Time::FromTimeT(
local_state->GetInt64(prefs::kInstallDate));
DCHECK(!install_time.is_null());
chrome_variations::SetupUniformityFieldTrials(install_time);
SetUpSimpleCacheFieldTrial();
#if !defined(OS_ANDROID) && !defined(OS_IOS)
SetupDesktopFieldTrials(local_state);
#endif // defined(OS_ANDROID)
#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
#if defined(OS_ANDROID) || defined(OS_IOS)
SetupMobileFieldTrials();
#endif // defined(OS_ANDROID) || defined(OS_IOS)
InstantiateDynamicTrials();
}
......@@ -116,7 +120,6 @@ void ChromeBrowserFieldTrials::SetupDesktopFieldTrials(
#if defined(ENABLE_ONE_CLICK_SIGNIN)
OneClickSigninHelper::InitializeFieldTrial();
#endif
InstantiateDynamicTrials();
SetupAppLauncherFieldTrial(local_state);
}
......
......@@ -1458,7 +1458,12 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// http://crbug.com/105065.
browser_process_->notification_ui_manager();
#if !defined(OS_ANDROID)
#if defined(OS_ANDROID)
chrome_variations::VariationsService* variations_service =
browser_process_->variations_service();
if (variations_service)
variations_service->StartRepeatedVariationsSeedFetch();
#else
// Most general initialization is behind us, but opening a
// tab and/or session restore and such is still to be done.
base::TimeTicks browser_open_start = base::TimeTicks::Now();
......
......@@ -251,8 +251,7 @@ void VariationsService::RegisterPrefs(PrefRegistrySimple* registry) {
// static
VariationsService* VariationsService::Create(PrefService* local_state) {
// This is temporarily disabled for Android. See http://crbug.com/168224
#if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)
#if !defined(GOOGLE_CHROME_BUILD)
// Unless the URL was provided, unsupported builds should return NULL to
// indicate that the service should not be used.
if (!CommandLine::ForCurrentProcess()->HasSwitch(
......
......@@ -204,6 +204,7 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
SSLConfigServiceManager::RegisterPrefs(registry);
UpgradeDetector::RegisterPrefs(registry);
WebCacheManager::RegisterPrefs(registry);
chrome_variations::VariationsService::RegisterPrefs(registry);
#if defined(ENABLE_PLUGINS)
PluginFinder::RegisterPrefs(registry);
......@@ -233,7 +234,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#if !defined(OS_ANDROID)
BackgroundModeManager::RegisterPrefs(registry);
chrome_variations::VariationsService::RegisterPrefs(registry);
RegisterBrowserPrefs(registry);
RegisterDefaultBrowserPromptPrefs(registry);
ManagedMode::RegisterPrefs(registry);
......
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