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