| 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 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h" | 5 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/common/channel_info.h" | 9 #include "chrome/common/channel_info.h" |
| 10 #include "components/version_info/version_info.h" | 10 #include "components/version_info/version_info.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 | 12 |
| 13 #if defined(OS_ANDROID) | |
| 14 #include "chrome/browser/android/preferences/pref_service_bridge.h" | |
| 15 #endif // OS_ANDROID | |
| 16 | |
| 17 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) | 13 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
| 18 #include "chrome/browser/upgrade_detector_impl.h" | 14 #include "chrome/browser/upgrade_detector_impl.h" |
| 19 #endif | 15 #endif |
| 20 | 16 |
| 21 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
| 22 #include "chrome/browser/chromeos/settings/cros_settings.h" | 18 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 23 #endif | 19 #endif |
| 24 | 20 |
| 21 #if defined(OS_ANDROID) |
| 22 #include "components/variations/android/variations_seed_bridge.h" |
| 23 #endif // OS_ANDROID |
| 24 |
| 25 namespace { | 25 namespace { |
| 26 | 26 |
| 27 // Gets the version number to use for variations seed simulation. Must be called | 27 // Gets the version number to use for variations seed simulation. Must be called |
| 28 // on a thread where IO is allowed. | 28 // on a thread where IO is allowed. |
| 29 base::Version GetVersionForSimulation() { | 29 base::Version GetVersionForSimulation() { |
| 30 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) | 30 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
| 31 const base::Version installed_version = | 31 const base::Version installed_version = |
| 32 UpgradeDetectorImpl::GetCurrentlyInstalledVersion(); | 32 UpgradeDetectorImpl::GetCurrentlyInstalledVersion(); |
| 33 if (installed_version.IsValid()) | 33 if (installed_version.IsValid()) |
| 34 return installed_version; | 34 return installed_version; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 chromeos::kVariationsRestrictParameter, parameter); | 79 chromeos::kVariationsRestrictParameter, parameter); |
| 80 return true; | 80 return true; |
| 81 #else | 81 #else |
| 82 return false; | 82 return false; |
| 83 #endif | 83 #endif |
| 84 } | 84 } |
| 85 | 85 |
| 86 variations::VariationsFirstRunSeedCallback | 86 variations::VariationsFirstRunSeedCallback |
| 87 ChromeVariationsServiceClient::GetVariationsFirstRunSeedCallback() { | 87 ChromeVariationsServiceClient::GetVariationsFirstRunSeedCallback() { |
| 88 #if defined(OS_ANDROID) | 88 #if defined(OS_ANDROID) |
| 89 return base::Bind(&PrefServiceBridge::GetVariationsFirstRunSeed); | 89 return base::Bind(&variations::android::GetVariationsFirstRunSeed); |
| 90 #else // OS_ANDROID | 90 #else // OS_ANDROID |
| 91 return variations::VariationsFirstRunSeedCallback(); | 91 return variations::VariationsFirstRunSeedCallback(); |
| 92 #endif // OS_ANDROID | 92 #endif // OS_ANDROID |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ChromeVariationsServiceClient::OnInitialStartup() { | 95 void ChromeVariationsServiceClient::OnInitialStartup() { |
| 96 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
| 97 StartGoogleUpdateRegistrySync(); | 97 StartGoogleUpdateRegistrySync(); |
| 98 #endif | 98 #endif |
| 99 } | 99 } |
| 100 | 100 |
| 101 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
| 102 void ChromeVariationsServiceClient::StartGoogleUpdateRegistrySync() { | 102 void ChromeVariationsServiceClient::StartGoogleUpdateRegistrySync() { |
| 103 registry_syncer_.RequestRegistrySync(); | 103 registry_syncer_.RequestRegistrySync(); |
| 104 } | 104 } |
| 105 #endif | 105 #endif |
| OLD | NEW |