Chromium Code Reviews| 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 // X-Client-Data request header. | 711 // X-Client-Data request header. |
| 712 variations::VariationsHttpHeaderProvider* provider = | 712 variations::VariationsHttpHeaderProvider* provider = |
| 713 variations::VariationsHttpHeaderProvider::GetInstance(); | 713 variations::VariationsHttpHeaderProvider::GetInstance(); |
| 714 bool result = provider->SetDefaultVariationIds( | 714 bool result = provider->SetDefaultVariationIds( |
| 715 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); | 715 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); |
| 716 CHECK(result) << "Invalid --" << switches::kForceVariationIds | 716 CHECK(result) << "Invalid --" << switches::kForceVariationIds |
| 717 << " list specified."; | 717 << " list specified."; |
| 718 metrics->AddSyntheticTrialObserver(provider); | 718 metrics->AddSyntheticTrialObserver(provider); |
| 719 } | 719 } |
| 720 | 720 |
| 721 // Associate parameters chosen in about:flags and create trial/group for them. | |
| 722 // TODO(jkrcal): don't create flags_strorage_ twice in chrome_browser_main.cc. | |
| 723 flags_ui::PrefServiceFlagsStorage flags_storage_( | |
|
Alexei Svitkine (slow)
2016/06/08 18:54:35
Nit: Local vars shouldn't have their names end wit
jkrcal
2016/06/09 09:55:15
Done.
| |
| 724 g_browser_process->local_state()); | |
| 725 about_flags::RegisterFeatureVariationParameters(&flags_storage_); | |
| 726 | |
| 721 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | 727 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 722 feature_list->InitializeFromCommandLine( | 728 feature_list->InitializeFromCommandLine( |
| 723 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 729 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 724 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 730 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 725 | 731 |
| 726 #if defined(FIELDTRIAL_TESTING_ENABLED) | 732 #if defined(FIELDTRIAL_TESTING_ENABLED) |
| 727 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && | 733 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && |
| 728 !command_line->HasSwitch(switches::kForceFieldTrials) && | 734 !command_line->HasSwitch(switches::kForceFieldTrials) && |
| 729 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { | 735 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { |
| 730 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); | 736 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); |
| (...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1993 chromeos::CrosSettings::Shutdown(); | 1999 chromeos::CrosSettings::Shutdown(); |
| 1994 #endif // defined(OS_CHROMEOS) | 2000 #endif // defined(OS_CHROMEOS) |
| 1995 #endif // defined(OS_ANDROID) | 2001 #endif // defined(OS_ANDROID) |
| 1996 } | 2002 } |
| 1997 | 2003 |
| 1998 // Public members: | 2004 // Public members: |
| 1999 | 2005 |
| 2000 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2006 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2001 chrome_extra_parts_.push_back(parts); | 2007 chrome_extra_parts_.push_back(parts); |
| 2002 } | 2008 } |
| OLD | NEW |