Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2016)

Unified Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 11753014: Enable the VariationsService on official builds when --variations-service-url is provided. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 12 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
« no previous file with comments | « chrome/browser/metrics/variations/variations_service.h ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations/variations_service.cc
diff --git a/chrome/browser/metrics/variations/variations_service.cc b/chrome/browser/metrics/variations/variations_service.cc
index b4e12da5b1bb716dbe4b3ddb0f88b9d6b3ae6461..8b50c6e5991a3c1949707c83c05fae3e40a7da2b 100644
--- a/chrome/browser/metrics/variations/variations_service.cc
+++ b/chrome/browser/metrics/variations/variations_service.cc
@@ -159,6 +159,10 @@ void VariationsService::StartRepeatedVariationsSeedFetch() {
this, &VariationsService::FetchVariationsSeed);
}
+void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) {
+ create_trials_from_seed_called_ = called;
+}
+
// static
void VariationsService::RegisterPrefs(PrefServiceSimple* prefs) {
prefs->RegisterStringPref(prefs::kVariationsSeed, std::string());
@@ -166,8 +170,17 @@ void VariationsService::RegisterPrefs(PrefServiceSimple* prefs) {
base::Time().ToInternalValue());
}
-void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) {
- create_trials_from_seed_called_ = called;
+// static
+VariationsService* VariationsService::Create() {
+// This is temporarily disabled for Android. See http://crbug.com/168224
+#if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)
+ // Unless the URL was provided, unsupported builds should return NULL to
+ // indicate that the service should not be used.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kVariationsServerURL))
+ return NULL;
+#endif
+ return new VariationsService;
}
void VariationsService::DoActualFetch() {
« no previous file with comments | « chrome/browser/metrics/variations/variations_service.h ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698