| 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 "base/build_time.h" | 7 #include "base/build_time.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/metrics/sparse_histogram.h" | 10 #include "base/metrics/sparse_histogram.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 // This should be called before the server URL has been computed. | 358 // This should be called before the server URL has been computed. |
| 359 DCHECK(variations_server_url_.is_empty()); | 359 DCHECK(variations_server_url_.is_empty()); |
| 360 restrict_mode_ = restrict_mode; | 360 restrict_mode_ = restrict_mode; |
| 361 } | 361 } |
| 362 | 362 |
| 363 void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) { | 363 void VariationsService::SetCreateTrialsFromSeedCalledForTesting(bool called) { |
| 364 DCHECK(thread_checker_.CalledOnValidThread()); | 364 DCHECK(thread_checker_.CalledOnValidThread()); |
| 365 create_trials_from_seed_called_ = called; | 365 create_trials_from_seed_called_ = called; |
| 366 } | 366 } |
| 367 | 367 |
| 368 // static | |
| 369 GURL VariationsService::GetVariationsServerURL( | 368 GURL VariationsService::GetVariationsServerURL( |
| 370 PrefService* policy_pref_service, | 369 PrefService* policy_pref_service, |
| 371 const std::string& restrict_mode_override) { | 370 const std::string& restrict_mode_override) { |
| 372 std::string server_url_string( | 371 std::string server_url_string( |
| 373 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 372 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 374 switches::kVariationsServerURL)); | 373 switches::kVariationsServerURL)); |
| 375 if (server_url_string.empty()) | 374 if (server_url_string.empty()) |
| 376 server_url_string = kDefaultServerUrl; | 375 server_url_string = kDefaultServerUrl; |
| 377 GURL server_url = GURL(server_url_string); | 376 GURL server_url = GURL(server_url_string); |
| 378 | 377 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 // Otherwise, update the pref with the current Chrome version and country. | 747 // Otherwise, update the pref with the current Chrome version and country. |
| 749 base::ListValue new_list_value; | 748 base::ListValue new_list_value; |
| 750 new_list_value.AppendString(version.GetString()); | 749 new_list_value.AppendString(version.GetString()); |
| 751 new_list_value.AppendString(latest_country); | 750 new_list_value.AppendString(latest_country); |
| 752 local_state_->Set(prefs::kVariationsPermanentConsistencyCountry, | 751 local_state_->Set(prefs::kVariationsPermanentConsistencyCountry, |
| 753 new_list_value); | 752 new_list_value); |
| 754 return latest_country; | 753 return latest_country; |
| 755 } | 754 } |
| 756 | 755 |
| 757 } // namespace chrome_variations | 756 } // namespace chrome_variations |
| OLD | NEW |