| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHROME_VARIATIONS_SERVICE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_METRICS_VARIATIONS_CHROME_VARIATIONS_SERVICE_CLIENT_H_ |
| 6 #define CHROME_BROWSER_METRICS_VARIATIONS_CHROME_VARIATIONS_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_METRICS_VARIATIONS_CHROME_VARIATIONS_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 #include "components/variations/service/variations_service_client.h" | 12 #include "components/variations/service/variations_service_client.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) | |
| 15 #include "chrome/browser/metrics/variations/variations_registry_syncer_win.h" | |
| 16 #endif | |
| 17 | |
| 18 // ChromeVariationsServiceClient provides an implementation of | 14 // ChromeVariationsServiceClient provides an implementation of |
| 19 // VariationsServiceClient that depends on chrome/. | 15 // VariationsServiceClient that depends on chrome/. |
| 20 class ChromeVariationsServiceClient | 16 class ChromeVariationsServiceClient |
| 21 : public variations::VariationsServiceClient { | 17 : public variations::VariationsServiceClient { |
| 22 public: | 18 public: |
| 23 ChromeVariationsServiceClient(); | 19 ChromeVariationsServiceClient(); |
| 24 ~ChromeVariationsServiceClient() override; | 20 ~ChromeVariationsServiceClient() override; |
| 25 | 21 |
| 26 // variations::VariationsServiceClient: | 22 // variations::VariationsServiceClient: |
| 27 std::string GetApplicationLocale() override; | 23 std::string GetApplicationLocale() override; |
| 28 base::SequencedWorkerPool* GetBlockingPool() override; | 24 base::SequencedWorkerPool* GetBlockingPool() override; |
| 29 base::Callback<base::Version(void)> GetVersionForSimulationCallback() | 25 base::Callback<base::Version(void)> GetVersionForSimulationCallback() |
| 30 override; | 26 override; |
| 31 net::URLRequestContextGetter* GetURLRequestContext() override; | 27 net::URLRequestContextGetter* GetURLRequestContext() override; |
| 32 network_time::NetworkTimeTracker* GetNetworkTimeTracker() override; | 28 network_time::NetworkTimeTracker* GetNetworkTimeTracker() override; |
| 33 version_info::Channel GetChannel() override; | 29 version_info::Channel GetChannel() override; |
| 34 bool OverridesRestrictParameter(std::string* parameter) override; | 30 bool OverridesRestrictParameter(std::string* parameter) override; |
| 35 void OnInitialStartup() override; | 31 void OnInitialStartup() override; |
| 36 | 32 |
| 37 private: | |
| 38 #if defined(OS_WIN) | |
| 39 // Starts syncing Google Update Variation IDs with the registry. | |
| 40 void StartGoogleUpdateRegistrySync(); | |
| 41 | |
| 42 // Helper that handles synchronizing Variations with the Registry. | |
| 43 chrome_variations::VariationsRegistrySyncer registry_syncer_; | |
| 44 #endif | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(ChromeVariationsServiceClient); | 33 DISALLOW_COPY_AND_ASSIGN(ChromeVariationsServiceClient); |
| 47 }; | 34 }; |
| 48 | 35 |
| 49 #endif // CHROME_BROWSER_METRICS_VARIATIONS_CHROME_VARIATIONS_SERVICE_CLIENT_H_ | 36 #endif // CHROME_BROWSER_METRICS_VARIATIONS_CHROME_VARIATIONS_SERVICE_CLIENT_H_ |
| OLD | NEW |