| 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 // X-Client-Data request header. | 713 // X-Client-Data request header. |
| 714 variations::VariationsHttpHeaderProvider* provider = | 714 variations::VariationsHttpHeaderProvider* provider = |
| 715 variations::VariationsHttpHeaderProvider::GetInstance(); | 715 variations::VariationsHttpHeaderProvider::GetInstance(); |
| 716 bool result = provider->SetDefaultVariationIds( | 716 bool result = provider->SetDefaultVariationIds( |
| 717 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); | 717 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); |
| 718 CHECK(result) << "Invalid --" << switches::kForceVariationIds | 718 CHECK(result) << "Invalid --" << switches::kForceVariationIds |
| 719 << " list specified."; | 719 << " list specified."; |
| 720 metrics->AddSyntheticTrialObserver(provider); | 720 metrics->AddSyntheticTrialObserver(provider); |
| 721 } | 721 } |
| 722 | 722 |
| 723 // Associate parameters chosen in about:flags and create trial/group for them. |
| 724 flags_ui::PrefServiceFlagsStorage flags_storage( |
| 725 g_browser_process->local_state()); |
| 726 about_flags::RegisterAllFeatureVariationParameters(&flags_storage); |
| 727 |
| 723 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); | 728 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); |
| 724 feature_list->InitializeFromCommandLine( | 729 feature_list->InitializeFromCommandLine( |
| 725 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 730 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
| 726 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 731 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
| 727 | 732 |
| 728 #if defined(FIELDTRIAL_TESTING_ENABLED) | 733 #if defined(FIELDTRIAL_TESTING_ENABLED) |
| 729 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && | 734 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && |
| 730 !command_line->HasSwitch(switches::kForceFieldTrials) && | 735 !command_line->HasSwitch(switches::kForceFieldTrials) && |
| 731 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { | 736 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { |
| 732 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); | 737 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 | 970 |
| 966 #if !defined(OS_CHROMEOS) | 971 #if !defined(OS_CHROMEOS) |
| 967 // Convert active labs into switches. This needs to be done before | 972 // Convert active labs into switches. This needs to be done before |
| 968 // ResourceBundle::InitSharedInstanceWithLocale as some loaded resources are | 973 // ResourceBundle::InitSharedInstanceWithLocale as some loaded resources are |
| 969 // affected by experiment flags (--touch-optimized-ui in particular). | 974 // affected by experiment flags (--touch-optimized-ui in particular). |
| 970 // On ChromeOS system level flags are applied from the device settings from | 975 // On ChromeOS system level flags are applied from the device settings from |
| 971 // the session manager. | 976 // the session manager. |
| 972 { | 977 { |
| 973 TRACE_EVENT0("startup", | 978 TRACE_EVENT0("startup", |
| 974 "ChromeBrowserMainParts::PreCreateThreadsImpl:ConvertFlags"); | 979 "ChromeBrowserMainParts::PreCreateThreadsImpl:ConvertFlags"); |
| 975 flags_ui::PrefServiceFlagsStorage flags_storage_( | 980 flags_ui::PrefServiceFlagsStorage flags_storage( |
| 976 g_browser_process->local_state()); | 981 g_browser_process->local_state()); |
| 977 about_flags::ConvertFlagsToSwitches(&flags_storage_, | 982 about_flags::ConvertFlagsToSwitches(&flags_storage, |
| 978 base::CommandLine::ForCurrentProcess(), | 983 base::CommandLine::ForCurrentProcess(), |
| 979 flags_ui::kAddSentinels); | 984 flags_ui::kAddSentinels); |
| 980 } | 985 } |
| 981 #endif // !defined(OS_CHROMEOS) | 986 #endif // !defined(OS_CHROMEOS) |
| 982 // The MaterialDesignController needs to look at command line flags, which | 987 // The MaterialDesignController needs to look at command line flags, which |
| 983 // are not available until this point. Now that they are, proceed with | 988 // are not available until this point. Now that they are, proceed with |
| 984 // initializing the MaterialDesignController. | 989 // initializing the MaterialDesignController. |
| 985 ui::MaterialDesignController::Initialize(); | 990 ui::MaterialDesignController::Initialize(); |
| 986 #if defined(OS_CHROMEOS) | 991 #if defined(OS_CHROMEOS) |
| 987 ash::MaterialDesignController::Initialize(); | 992 ash::MaterialDesignController::Initialize(); |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1992 chromeos::CrosSettings::Shutdown(); | 1997 chromeos::CrosSettings::Shutdown(); |
| 1993 #endif // defined(OS_CHROMEOS) | 1998 #endif // defined(OS_CHROMEOS) |
| 1994 #endif // defined(OS_ANDROID) | 1999 #endif // defined(OS_ANDROID) |
| 1995 } | 2000 } |
| 1996 | 2001 |
| 1997 // Public members: | 2002 // Public members: |
| 1998 | 2003 |
| 1999 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2004 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2000 chrome_extra_parts_.push_back(parts); | 2005 chrome_extra_parts_.push_back(parts); |
| 2001 } | 2006 } |
| OLD | NEW |