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 #include "chrome/browser/metrics/variations/variations_service.h" | 5 #include "chrome/browser/metrics/variations/variations_service.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/build_time.h" | 10 #include "base/build_time.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 registry->RegisterStringPref(prefs::kVariationsSeed, std::string()); | 244 registry->RegisterStringPref(prefs::kVariationsSeed, std::string()); |
245 registry->RegisterInt64Pref(prefs::kVariationsSeedDate, | 245 registry->RegisterInt64Pref(prefs::kVariationsSeedDate, |
246 base::Time().ToInternalValue()); | 246 base::Time().ToInternalValue()); |
247 registry->RegisterInt64Pref(prefs::kVariationsLastFetchTime, 0); | 247 registry->RegisterInt64Pref(prefs::kVariationsLastFetchTime, 0); |
248 registry->RegisterStringPref(prefs::kVariationsRestrictParameter, | 248 registry->RegisterStringPref(prefs::kVariationsRestrictParameter, |
249 std::string()); | 249 std::string()); |
250 } | 250 } |
251 | 251 |
252 // static | 252 // static |
253 VariationsService* VariationsService::Create(PrefService* local_state) { | 253 VariationsService* VariationsService::Create(PrefService* local_state) { |
254 // This is temporarily disabled for Android. See http://crbug.com/168224 | 254 #if !defined(GOOGLE_CHROME_BUILD) |
255 #if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID) | |
256 // Unless the URL was provided, unsupported builds should return NULL to | 255 // Unless the URL was provided, unsupported builds should return NULL to |
257 // indicate that the service should not be used. | 256 // indicate that the service should not be used. |
258 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 257 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
259 switches::kVariationsServerURL)) | 258 switches::kVariationsServerURL)) |
260 return NULL; | 259 return NULL; |
261 #endif | 260 #endif |
262 return new VariationsService(local_state); | 261 return new VariationsService(local_state); |
263 } | 262 } |
264 | 263 |
265 void VariationsService::DoActualFetch() { | 264 void VariationsService::DoActualFetch() { |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 | 647 |
649 void VariationsService::RecordLastFetchTime() { | 648 void VariationsService::RecordLastFetchTime() { |
650 // local_state_ is NULL in tests, so check it first. | 649 // local_state_ is NULL in tests, so check it first. |
651 if (local_state_) { | 650 if (local_state_) { |
652 local_state_->SetInt64(prefs::kVariationsLastFetchTime, | 651 local_state_->SetInt64(prefs::kVariationsLastFetchTime, |
653 base::Time::Now().ToInternalValue()); | 652 base::Time::Now().ToInternalValue()); |
654 } | 653 } |
655 } | 654 } |
656 | 655 |
657 } // namespace chrome_variations | 656 } // namespace chrome_variations |
OLD | NEW |