| 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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 // X-Client-Data request header. | 716 // X-Client-Data request header. |
| 717 variations::VariationsHttpHeaderProvider* provider = | 717 variations::VariationsHttpHeaderProvider* provider = |
| 718 variations::VariationsHttpHeaderProvider::GetInstance(); | 718 variations::VariationsHttpHeaderProvider::GetInstance(); |
| 719 bool result = provider->SetDefaultVariationIds( | 719 bool result = provider->SetDefaultVariationIds( |
| 720 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); | 720 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); |
| 721 CHECK(result) << "Invalid --" << switches::kForceVariationIds | 721 CHECK(result) << "Invalid --" << switches::kForceVariationIds |
| 722 << " list specified."; | 722 << " list specified."; |
| 723 metrics->AddSyntheticTrialObserver(provider); | 723 metrics->AddSyntheticTrialObserver(provider); |
| 724 } | 724 } |
| 725 | 725 |
| 726 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 727 |
| 726 // Associate parameters chosen in about:flags and create trial/group for them. | 728 // Associate parameters chosen in about:flags and create trial/group for them. |
| 727 flags_ui::PrefServiceFlagsStorage flags_storage( | 729 flags_ui::PrefServiceFlagsStorage flags_storage( |
| 728 g_browser_process->local_state()); | 730 g_browser_process->local_state()); |
| 729 about_flags::RegisterAllFeatureVariationParameters(&flags_storage); | 731 about_flags::RegisterAllFeatureVariationParameters(&flags_storage, |
| 732 feature_list.get()); |
| 730 | 733 |
| 731 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | |
| 732 feature_list->InitializeFromCommandLine( | 734 feature_list->InitializeFromCommandLine( |
| 733 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 735 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 734 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 736 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 735 | 737 |
| 736 #if defined(FIELDTRIAL_TESTING_ENABLED) | 738 #if defined(FIELDTRIAL_TESTING_ENABLED) |
| 737 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && | 739 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && |
| 738 !command_line->HasSwitch(switches::kForceFieldTrials) && | 740 !command_line->HasSwitch(switches::kForceFieldTrials) && |
| 739 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { | 741 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { |
| 740 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); | 742 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); |
| 741 } | 743 } |
| (...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2034 chromeos::CrosSettings::Shutdown(); | 2036 chromeos::CrosSettings::Shutdown(); |
| 2035 #endif // defined(OS_CHROMEOS) | 2037 #endif // defined(OS_CHROMEOS) |
| 2036 #endif // defined(OS_ANDROID) | 2038 #endif // defined(OS_ANDROID) |
| 2037 } | 2039 } |
| 2038 | 2040 |
| 2039 // Public members: | 2041 // Public members: |
| 2040 | 2042 |
| 2041 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2043 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2042 chrome_extra_parts_.push_back(parts); | 2044 chrome_extra_parts_.push_back(parts); |
| 2043 } | 2045 } |
| OLD | NEW |