| 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 "components/variations/service/variations_service.h" | 5 #include "components/variations/service/variations_service.h" |
| 6 | 6 |
| 7 #include <vector> |
| 8 |
| 7 #include "base/build_time.h" | 9 #include "base/build_time.h" |
| 8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 12 #include "base/metrics/sparse_histogram.h" |
| 11 #include "base/prefs/pref_registry_simple.h" | 13 #include "base/prefs/pref_registry_simple.h" |
| 12 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
| 13 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 14 #include "base/sys_info.h" | 16 #include "base/sys_info.h" |
| 15 #include "base/task_runner_util.h" | 17 #include "base/task_runner_util.h" |
| 16 #include "base/timer/elapsed_timer.h" | 18 #include "base/timer/elapsed_timer.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 create_trials_from_seed_called_(false), | 283 create_trials_from_seed_called_(false), |
| 282 initial_request_completed_(false), | 284 initial_request_completed_(false), |
| 283 disable_deltas_for_next_request_(false), | 285 disable_deltas_for_next_request_(false), |
| 284 resource_request_allowed_notifier_(notifier.Pass()), | 286 resource_request_allowed_notifier_(notifier.Pass()), |
| 285 request_count_(0), | 287 request_count_(0), |
| 286 weak_ptr_factory_(this) { | 288 weak_ptr_factory_(this) { |
| 287 DCHECK(client_.get()); | 289 DCHECK(client_.get()); |
| 288 DCHECK(resource_request_allowed_notifier_.get()); | 290 DCHECK(resource_request_allowed_notifier_.get()); |
| 289 | 291 |
| 290 resource_request_allowed_notifier_->Init(this); | 292 resource_request_allowed_notifier_->Init(this); |
| 293 #if defined(OS_ANDROID) |
| 294 seed_store_.SetVariationsFirstRunSeedCallback( |
| 295 client_->GetVariationsFirstRunSeedCallback()); |
| 296 #endif // OS_ANDROID |
| 291 } | 297 } |
| 292 | 298 |
| 293 VariationsService::~VariationsService() { | 299 VariationsService::~VariationsService() { |
| 294 } | 300 } |
| 295 | 301 |
| 296 bool VariationsService::CreateTrialsFromSeed(base::FeatureList* feature_list) { | 302 bool VariationsService::CreateTrialsFromSeed(base::FeatureList* feature_list) { |
| 297 DCHECK(thread_checker_.CalledOnValidThread()); | 303 DCHECK(thread_checker_.CalledOnValidThread()); |
| 298 | 304 |
| 299 create_trials_from_seed_called_ = true; | 305 create_trials_from_seed_called_ = true; |
| 300 | 306 |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 std::string stored_country; | 859 std::string stored_country; |
| 854 | 860 |
| 855 if (list_value->GetSize() == 2) { | 861 if (list_value->GetSize() == 2) { |
| 856 list_value->GetString(1, &stored_country); | 862 list_value->GetString(1, &stored_country); |
| 857 } | 863 } |
| 858 | 864 |
| 859 return stored_country; | 865 return stored_country; |
| 860 } | 866 } |
| 861 | 867 |
| 862 } // namespace variations | 868 } // namespace variations |
| OLD | NEW |