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 |
13 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) | 17 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
14 #include "chrome/browser/upgrade_detector_impl.h" | 18 #include "chrome/browser/upgrade_detector_impl.h" |
15 #endif | 19 #endif |
16 | 20 |
17 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
18 #include "chrome/browser/chromeos/settings/cros_settings.h" | 22 #include "chrome/browser/chromeos/settings/cros_settings.h" |
19 #endif | 23 #endif |
20 | 24 |
21 namespace { | 25 namespace { |
22 | 26 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 std::string* parameter) { | 76 std::string* parameter) { |
73 #if defined(OS_CHROMEOS) | 77 #if defined(OS_CHROMEOS) |
74 chromeos::CrosSettings::Get()->GetString( | 78 chromeos::CrosSettings::Get()->GetString( |
75 chromeos::kVariationsRestrictParameter, parameter); | 79 chromeos::kVariationsRestrictParameter, parameter); |
76 return true; | 80 return true; |
77 #else | 81 #else |
78 return false; | 82 return false; |
79 #endif | 83 #endif |
80 } | 84 } |
81 | 85 |
| 86 variations::VariationsFirstRunSeedCallback |
| 87 ChromeVariationsServiceClient::GetVariationsFirstRunSeedCallback() { |
| 88 #if defined(OS_ANDROID) |
| 89 return base::Bind(&PrefServiceBridge::GetVariationsFirstRunSeed); |
| 90 #else // OS_ANDROID |
| 91 return variations::VariationsFirstRunSeedCallback(); |
| 92 #endif // OS_ANDROID |
| 93 } |
| 94 |
82 void ChromeVariationsServiceClient::OnInitialStartup() { | 95 void ChromeVariationsServiceClient::OnInitialStartup() { |
83 #if defined(OS_WIN) | 96 #if defined(OS_WIN) |
84 StartGoogleUpdateRegistrySync(); | 97 StartGoogleUpdateRegistrySync(); |
85 #endif | 98 #endif |
86 } | 99 } |
87 | 100 |
88 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
89 void ChromeVariationsServiceClient::StartGoogleUpdateRegistrySync() { | 102 void ChromeVariationsServiceClient::StartGoogleUpdateRegistrySync() { |
90 registry_syncer_.RequestRegistrySync(); | 103 registry_syncer_.RequestRegistrySync(); |
91 } | 104 } |
92 #endif | 105 #endif |
OLD | NEW |