Chromium Code Reviews| Index: chrome/browser/chrome_browser_main.cc |
| diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc |
| index 1166a7f31c04fbf2c8ea7305a92023145c11118f..6b33770b2c9df3d6bffe99ae5ca48a75d31c4cea 100644 |
| --- a/chrome/browser/chrome_browser_main.cc |
| +++ b/chrome/browser/chrome_browser_main.cc |
| @@ -730,25 +730,27 @@ void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { |
| << " list specified."; |
| } |
| - if (command_line->HasSwitch(switches::kForceVariationIds)) { |
| - // Create default variation ids which will always be included in the |
| - // X-Client-Data request header. |
| - variations::VariationsHttpHeaderProvider* provider = |
| - variations::VariationsHttpHeaderProvider::GetInstance(); |
| - bool result = provider->SetDefaultVariationIds( |
| - command_line->GetSwitchValueASCII(switches::kForceVariationIds)); |
| - CHECK(result) << "Invalid --" << switches::kForceVariationIds |
| - << " list specified."; |
| - metrics->AddSyntheticTrialObserver(provider); |
| - } |
| - |
| std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| // Associate parameters chosen in about:flags and create trial/group for them. |
| flags_ui::PrefServiceFlagsStorage flags_storage( |
| g_browser_process->local_state()); |
| - about_flags::RegisterAllFeatureVariationParameters(&flags_storage, |
| - feature_list.get()); |
| + std::vector<std::string> variation_ids = |
| + about_flags::RegisterAllFeatureVariationParameters( |
| + &flags_storage, feature_list.get()); |
| + |
| + // Create default variation ids which will always be included in the |
| + // X-Client-Data request header. |
|
Alexei Svitkine (slow)
2016/07/27 15:04:18
This comment was actually about the command line f
jkrcal
2016/07/27 17:12:43
Done.
|
| + variations::VariationsHttpHeaderProvider* http_header_provider = |
| + variations::VariationsHttpHeaderProvider::GetInstance(); |
| + // Force the variation ids selected in chrome://flags and/or specified using |
| + // the command-line flag. |
| + bool result = http_header_provider->ForceVariationIds( |
| + &variation_ids, |
| + command_line->GetSwitchValueASCII(switches::kForceVariationIds)); |
| + CHECK(result) << "Invalid list of variation ids specified (either in --" |
| + << switches::kForceVariationIds << " or in chrome://flags)"; |
| + metrics->AddSyntheticTrialObserver(http_header_provider); |
| feature_list->InitializeFromCommandLine( |
| command_line->GetSwitchValueASCII(switches::kEnableFeatures), |