Chromium Code Reviews| Index: chrome/browser/metrics/variations/variations_service.h |
| diff --git a/chrome/browser/metrics/variations/variations_service.h b/chrome/browser/metrics/variations/variations_service.h |
| index 5a363874deafeb12d1c1abf36b7811bc7c3052de..380bd8eb31be91cb5a3a12216410f6d3706d6a83 100644 |
| --- a/chrome/browser/metrics/variations/variations_service.h |
| +++ b/chrome/browser/metrics/variations/variations_service.h |
| @@ -31,12 +31,6 @@ class VariationsService |
| : public net::URLFetcherDelegate, |
| public ResourceRequestAllowedNotifier::Observer { |
| public: |
| - VariationsService(); |
| - |
| - // This constructor exists for injecting a mock notifier. It is meant for |
| - // testing only. This instance will take ownership of |notifier|. |
| - explicit VariationsService(ResourceRequestAllowedNotifier* notifier); |
| - |
| virtual ~VariationsService(); |
| // Creates field trials based on Variations Seed loaded from local prefs. If |
| @@ -49,17 +43,24 @@ class VariationsService |
| // |CreateTrialsFromSeed|. |
| void StartRepeatedVariationsSeedFetch(); |
| + // Exposed for testing. |
| + void SetCreateTrialsFromSeedCalledForTesting(bool called); |
|
Alexei Svitkine (slow)
2013/01/03 20:14:06
Are you using this somewhere?
SteveT
2013/01/03 20:35:42
I believe this is used by the tests. It was just m
Alexei Svitkine (slow)
2013/01/03 20:40:42
Ah, I misread the diff before. SGTM.
|
| + |
| // Register Variations related prefs in Local State. |
| static void RegisterPrefs(PrefServiceSimple* prefs); |
| - // Exposed for testing. |
| - void SetCreateTrialsFromSeedCalledForTesting(bool called); |
| + // Factory method for creating a VariationsService. |
| + static VariationsService* Create(); |
| protected: |
| // Starts the fetching process once, where |OnURLFetchComplete| is called with |
| // the response. |
| virtual void DoActualFetch(); |
| + // This constructor exists for injecting a mock notifier. It is meant for |
| + // testing only. This instance will take ownership of |notifier|. |
| + explicit VariationsService(ResourceRequestAllowedNotifier* notifier); |
| + |
| private: |
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, CheckStudyChannel); |
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, CheckStudyLocale); |
| @@ -75,6 +76,10 @@ class VariationsService |
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, StoreSeed); |
| FRIEND_TEST_ALL_PREFIXES(VariationsServiceTest, ValidateStudy); |
| + // Default constructor is private. Use the |Create| factory method to create a |
| + // VariationsService. |
| + VariationsService(); |
| + |
| // Checks if prerequisites for fetching the Variations seed are met, and if |
| // so, performs the actual fetch using |DoActualFetch|. |
| void FetchVariationsSeed(); |