Chromium Code Reviews| 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" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/metrics/variations/variations_request_scheduler.h" | 17 #include "chrome/browser/metrics/variations/variations_request_scheduler.h" |
| 18 #include "chrome/browser/metrics/variations/variations_seed_store.h" | 18 #include "chrome/browser/metrics/variations/variations_seed_store.h" |
| 19 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | |
|
grt (UTC plus 2)
2014/10/14 01:28:30
unused
Georges Khalil
2014/10/14 13:51:10
Done.
| |
| 19 #include "chrome/browser/web_resource/resource_request_allowed_notifier.h" | 20 #include "chrome/browser/web_resource/resource_request_allowed_notifier.h" |
| 20 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
| 21 #include "components/variations/variations_seed_simulator.h" | 22 #include "components/variations/variations_seed_simulator.h" |
| 22 #include "net/url_request/url_fetcher_delegate.h" | 23 #include "net/url_request/url_fetcher_delegate.h" |
| 23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 24 | 25 |
| 25 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 26 #include "chrome/browser/metrics/variations/variations_registry_syncer_win.h" | 27 #include "chrome/browser/metrics/variations/variations_registry_syncer_win.h" |
| 27 #endif | 28 #endif |
| 28 | 29 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 PrefService* local_state, | 127 PrefService* local_state, |
| 127 metrics::MetricsStateManager* state_manager); | 128 metrics::MetricsStateManager* state_manager); |
| 128 | 129 |
| 129 // Set the PrefService responsible for getting policy-related preferences, | 130 // Set the PrefService responsible for getting policy-related preferences, |
| 130 // such as the restrict parameter. | 131 // such as the restrict parameter. |
| 131 void set_policy_pref_service(PrefService* service) { | 132 void set_policy_pref_service(PrefService* service) { |
| 132 DCHECK(service); | 133 DCHECK(service); |
| 133 policy_pref_service_ = service; | 134 policy_pref_service_ = service; |
| 134 } | 135 } |
| 135 | 136 |
| 137 // Returns true if the variations seed signature is invalid, in which case | |
| 138 // it also sets invalid_signature to that value. | |
| 139 bool IsVariationsSeedSignatureInvalid(std::string* invalid_signature) const { | |
| 140 return seed_store_.GetInvalidSignature(invalid_signature); | |
| 141 } | |
| 142 | |
| 143 | |
| 136 protected: | 144 protected: |
| 137 // Starts the fetching process once, where |OnURLFetchComplete| is called with | 145 // Starts the fetching process once, where |OnURLFetchComplete| is called with |
| 138 // the response. | 146 // the response. |
| 139 virtual void DoActualFetch(); | 147 virtual void DoActualFetch(); |
| 140 | 148 |
| 141 // Stores the seed to prefs. Set as virtual and protected so that it can be | 149 // Stores the seed to prefs. Set as virtual and protected so that it can be |
| 142 // overridden by tests. | 150 // overridden by tests. |
| 143 virtual void StoreSeed(const std::string& seed_data, | 151 virtual void StoreSeed(const std::string& seed_data, |
| 144 const std::string& seed_signature, | 152 const std::string& seed_signature, |
| 145 const base::Time& date_fetched); | 153 const base::Time& date_fetched); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 #endif | 238 #endif |
| 231 | 239 |
| 232 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; | 240 base::WeakPtrFactory<VariationsService> weak_ptr_factory_; |
| 233 | 241 |
| 234 DISALLOW_COPY_AND_ASSIGN(VariationsService); | 242 DISALLOW_COPY_AND_ASSIGN(VariationsService); |
| 235 }; | 243 }; |
| 236 | 244 |
| 237 } // namespace chrome_variations | 245 } // namespace chrome_variations |
| 238 | 246 |
| 239 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ | 247 #endif // CHROME_BROWSER_METRICS_VARIATIONS_VARIATIONS_SERVICE_H_ |
| OLD | NEW |