| Index: components/variations/service/variations_service.cc
|
| diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
|
| index 826fe0d864f2ebcb388d3d97f6030d450a60fe3d..e669699c2cdeb152dfc3820abfac56610c5e31e1 100644
|
| --- a/components/variations/service/variations_service.cc
|
| +++ b/components/variations/service/variations_service.cc
|
| @@ -8,6 +8,7 @@
|
| #include <stdint.h>
|
|
|
| #include <utility>
|
| +#include <vector>
|
|
|
| #include "base/build_time.h"
|
| #include "base/command_line.h"
|
| @@ -336,9 +337,7 @@ bool VariationsService::CreateTrialsFromSeed(base::FeatureList* feature_list) {
|
| GetChannelForVariations(client_->GetChannel());
|
| UMA_HISTOGRAM_SPARSE_SLOWLY("Variations.UserChannel", channel);
|
|
|
| - const std::string latest_country =
|
| - local_state_->GetString(prefs::kVariationsCountry);
|
| -
|
| + const std::string latest_country = GetLatestCountry();
|
| std::unique_ptr<const base::FieldTrial::EntropyProvider> low_entropy_provider(
|
| CreateLowEntropyProvider());
|
| // Note that passing |&ui_string_overrider_| via base::Unretained below is
|
| @@ -780,8 +779,7 @@ void VariationsService::PerformSimulationWithVersion(
|
| variations::VariationsSeedSimulator seed_simulator(*default_provider,
|
| *low_provider);
|
|
|
| - const std::string latest_country =
|
| - local_state_->GetString(prefs::kVariationsCountry);
|
| + const std::string latest_country = GetLatestCountry();
|
| const variations::VariationsSeedSimulator::Result result =
|
| seed_simulator.SimulateSeedStudies(
|
| *seed, client_->GetApplicationLocale(),
|
| @@ -823,6 +821,12 @@ std::string VariationsService::LoadPermanentConsistencyCountry(
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| DCHECK(version.IsValid());
|
|
|
| + const std::string override_country =
|
| + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| + switches::kVariationsOverrideCountry);
|
| + if (!override_country.empty())
|
| + return override_country;
|
| +
|
| const base::ListValue* list_value =
|
| local_state_->GetList(prefs::kVariationsPermanentConsistencyCountry);
|
| std::string stored_version_string;
|
| @@ -930,7 +934,12 @@ bool VariationsService::OverrideStoredPermanentCountry(
|
| }
|
|
|
| std::string VariationsService::GetLatestCountry() const {
|
| - return local_state_->GetString(prefs::kVariationsCountry);
|
| + const std::string override_country =
|
| + base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| + switches::kVariationsOverrideCountry);
|
| + return !override_country.empty()
|
| + ? override_country
|
| + : local_state_->GetString(prefs::kVariationsCountry);
|
| }
|
|
|
| } // namespace variations
|
|
|