| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ | 5 #ifndef COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ |
| 6 #define COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ | 6 #define COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "components/variations/variations_seed_simulator.h" | 21 #include "components/variations/variations_seed_simulator.h" |
| 22 #include "components/variations/variations_seed_store.h" | 22 #include "components/variations/variations_seed_store.h" |
| 23 #include "components/web_resource/resource_request_allowed_notifier.h" | 23 #include "components/web_resource/resource_request_allowed_notifier.h" |
| 24 #include "net/url_request/url_fetcher_delegate.h" | 24 #include "net/url_request/url_fetcher_delegate.h" |
| 25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 26 | 26 |
| 27 class PrefService; | 27 class PrefService; |
| 28 class PrefRegistrySimple; | 28 class PrefRegistrySimple; |
| 29 | 29 |
| 30 namespace base { | 30 namespace base { |
| 31 class FeatureList; |
| 31 class Version; | 32 class Version; |
| 32 } | 33 } |
| 33 | 34 |
| 34 namespace metrics { | 35 namespace metrics { |
| 35 class MetricsStateManager; | 36 class MetricsStateManager; |
| 36 } | 37 } |
| 37 | 38 |
| 38 namespace user_prefs { | 39 namespace user_prefs { |
| 39 class PrefRegistrySyncable; | 40 class PrefRegistrySyncable; |
| 40 } | 41 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 65 // experiment changes on a restart. This notification can then be used to | 66 // experiment changes on a restart. This notification can then be used to |
| 66 // update UI (i.e. badging an icon). | 67 // update UI (i.e. badging an icon). |
| 67 virtual void OnExperimentChangesDetected(Severity severity) = 0; | 68 virtual void OnExperimentChangesDetected(Severity severity) = 0; |
| 68 | 69 |
| 69 protected: | 70 protected: |
| 70 virtual ~Observer() {} | 71 virtual ~Observer() {} |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 ~VariationsService() override; | 74 ~VariationsService() override; |
| 74 | 75 |
| 75 // Creates field trials based on Variations Seed loaded from local prefs. If | 76 // Creates field trials based on the variations seed loaded from local state. |
| 76 // there is a problem loading the seed data, all trials specified by the seed | 77 // If there is a problem loading the seed data, all trials specified by the |
| 77 // may not be created. | 78 // seed may not be created. Some field trials are configured to override or |
| 78 bool CreateTrialsFromSeed(); | 79 // associate with (for reporting) specific features. These associations are |
| 80 // registered with |feature_list|. |
| 81 bool CreateTrialsFromSeed(base::FeatureList* feature_list); |
| 79 | 82 |
| 80 // Should be called before startup of the main message loop. | 83 // Should be called before startup of the main message loop. |
| 81 void PerformPreMainMessageLoopStartup(); | 84 void PerformPreMainMessageLoopStartup(); |
| 82 | 85 |
| 83 // Calls FetchVariationsSeed once and repeats this periodically. See | 86 // Calls FetchVariationsSeed once and repeats this periodically. See |
| 84 // implementation for details on the period. Must be called after | 87 // implementation for details on the period. Must be called after |
| 85 // |CreateTrialsFromSeed|. | 88 // |CreateTrialsFromSeed|. |
| 86 void StartRepeatedVariationsSeedFetch(); | 89 void StartRepeatedVariationsSeedFetch(); |
| 87 | 90 |
| 88 // Adds an observer to listen for detected experiment changes. | 91 // Adds an observer to listen for detected experiment changes. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 base::ThreadChecker thread_checker_; | 297 base::ThreadChecker thread_checker_; |
| 295 | 298 |
| 296 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; | 299 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; |
| 297 | 300 |
| 298 DISALLOW_COPY_AND_ASSIGN(VariationsService); | 301 DISALLOW_COPY_AND_ASSIGN(VariationsService); |
| 299 }; | 302 }; |
| 300 | 303 |
| 301 } // namespace variations | 304 } // namespace variations |
| 302 | 305 |
| 303 #endif // COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ | 306 #endif // COMPONENTS_VARIATIONS_SERVICE_VARIATIONS_SERVICE_H_ |
| OLD | NEW |