Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 2129543002: Registering field trial for a feature overridden in chrome://flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/flags_ui/flags_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 // X-Client-Data request header. 720 // X-Client-Data request header.
721 variations::VariationsHttpHeaderProvider* provider = 721 variations::VariationsHttpHeaderProvider* provider =
722 variations::VariationsHttpHeaderProvider::GetInstance(); 722 variations::VariationsHttpHeaderProvider::GetInstance();
723 bool result = provider->SetDefaultVariationIds( 723 bool result = provider->SetDefaultVariationIds(
724 command_line->GetSwitchValueASCII(switches::kForceVariationIds)); 724 command_line->GetSwitchValueASCII(switches::kForceVariationIds));
725 CHECK(result) << "Invalid --" << switches::kForceVariationIds 725 CHECK(result) << "Invalid --" << switches::kForceVariationIds
726 << " list specified."; 726 << " list specified.";
727 metrics->AddSyntheticTrialObserver(provider); 727 metrics->AddSyntheticTrialObserver(provider);
728 } 728 }
729 729
730 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
731
730 // Associate parameters chosen in about:flags and create trial/group for them. 732 // Associate parameters chosen in about:flags and create trial/group for them.
731 flags_ui::PrefServiceFlagsStorage flags_storage( 733 flags_ui::PrefServiceFlagsStorage flags_storage(
732 g_browser_process->local_state()); 734 g_browser_process->local_state());
733 about_flags::RegisterAllFeatureVariationParameters(&flags_storage); 735 about_flags::RegisterAllFeatureVariationParameters(&flags_storage,
736 feature_list.get());
734 737
735 std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
736 feature_list->InitializeFromCommandLine( 738 feature_list->InitializeFromCommandLine(
737 command_line->GetSwitchValueASCII(switches::kEnableFeatures), 739 command_line->GetSwitchValueASCII(switches::kEnableFeatures),
738 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); 740 command_line->GetSwitchValueASCII(switches::kDisableFeatures));
739 741
740 #if defined(FIELDTRIAL_TESTING_ENABLED) 742 #if defined(FIELDTRIAL_TESTING_ENABLED)
741 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && 743 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) &&
742 !command_line->HasSwitch(switches::kForceFieldTrials) && 744 !command_line->HasSwitch(switches::kForceFieldTrials) &&
743 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { 745 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) {
744 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); 746 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get());
745 } 747 }
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 chromeos::CrosSettings::Shutdown(); 2040 chromeos::CrosSettings::Shutdown();
2039 #endif // defined(OS_CHROMEOS) 2041 #endif // defined(OS_CHROMEOS)
2040 #endif // defined(OS_ANDROID) 2042 #endif // defined(OS_ANDROID)
2041 } 2043 }
2042 2044
2043 // Public members: 2045 // Public members:
2044 2046
2045 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2047 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2046 chrome_extra_parts_.push_back(parts); 2048 chrome_extra_parts_.push_back(parts);
2047 } 2049 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/flags_ui/flags_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698