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 CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ |
6 #define CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ | 6 #define CHROME_BROWSER_METRICS_VARIATIONS_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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 PrefService* local_state, | 126 PrefService* local_state, |
127 metrics::MetricsStateManager* state_manager); | 127 metrics::MetricsStateManager* state_manager); |
128 | 128 |
129 // Set the PrefService responsible for getting policy-related preferences, | 129 // Set the PrefService responsible for getting policy-related preferences, |
130 // such as the restrict parameter. | 130 // such as the restrict parameter. |
131 void set_policy_pref_service(PrefService* service) { | 131 void set_policy_pref_service(PrefService* service) { |
132 DCHECK(service); | 132 DCHECK(service); |
133 policy_pref_service_ = service; | 133 policy_pref_service_ = service; |
134 } | 134 } |
135 | 135 |
136 // Returns true if the variations seed signature is invalid, in which case | |
137 // it also sets invalid_signature to that value. | |
138 bool IsVariationsSeedSignatureInvalid(std::string* invalid_signature) const { | |
Alexei Svitkine (slow)
2014/10/14 17:30:01
This should be implemented in the .cc file, since
Georges Khalil
2014/10/14 18:00:32
Done.
| |
139 return seed_store_.GetInvalidSignature(invalid_signature); | |
140 } | |
141 | |
136 protected: | 142 protected: |
137 // Starts the fetching process once, where |OnURLFetchComplete| is called with | 143 // Starts the fetching process once, where |OnURLFetchComplete| is called with |
138 // the response. | 144 // the response. |
139 virtual void DoActualFetch(); | 145 virtual void DoActualFetch(); |
140 | 146 |
141 // Stores the seed to prefs. Set as virtual and protected so that it can be | 147 // Stores the seed to prefs. Set as virtual and protected so that it can be |
142 // overridden by tests. | 148 // overridden by tests. |
143 virtual void StoreSeed(const std::string& seed_data, | 149 virtual void StoreSeed(const std::string& seed_data, |
144 const std::string& seed_signature, | 150 const std::string& seed_signature, |
145 const base::Time& date_fetched); | 151 const base::Time& date_fetched); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 #endif | 236 #endif |
231 | 237 |
232 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; | 238 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; |
233 | 239 |
234 DISALLOW_COPY_AND_ASSIGN(VariationsService); | 240 DISALLOW_COPY_AND_ASSIGN(VariationsService); |
235 }; | 241 }; |
236 | 242 |
237 } // namespace chrome_variations | 243 } // namespace chrome_variations |
238 | 244 |
239 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ | 245 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ |
OLD | NEW |