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

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: init 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
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..6e9b6e72c655741ddb2ab1ef67c5a1ed9d188a7c 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,16 @@ void VariationsService::RegisterPrefs(PrefServiceSimple* prefs) {
base::Time().ToInternalValue());
}
-void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) {
- create_trials_from_seed_called_ = called;
+// static
+VariationsService* VariationsService::Create() {
+#if defined(GOOGLE_CHROME_BUILD) && !defined(OS_ANDROID)
Alexei Svitkine (slow) 2013/01/03 20:14:06 Do we have a bug tracking the !ANDROID part? If so
SteveT 2013/01/03 20:35:42 Done.
+ // Unless the URL was provided, unsupported builds should return NULL to
Alexei Svitkine (slow) 2013/01/03 20:14:06 I think "unofficial" is the correct term.
SteveT 2013/01/03 20:35:42 So I originally used unofficial, but I changed the
Alexei Svitkine (slow) 2013/01/03 20:40:42 Ah, makes sense. OK.
+ // indicate that the service should not be used.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kVariationsServerURL))
+ return NULL;
+#endif
+ return new VariationsService;
}
void VariationsService::DoActualFetch() {

Powered by Google App Engine
This is Rietveld 408576698