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

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

Issue 2465953002: Move Field Trial Utils from chrome/common/variations to components/variations/field_trial_util (Closed)
Patch Set: Created 4 years, 1 month 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
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 <map> 10 #include <map>
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 #include "chrome/common/chrome_switches.h" 109 #include "chrome/common/chrome_switches.h"
110 #include "chrome/common/crash_keys.h" 110 #include "chrome/common/crash_keys.h"
111 #include "chrome/common/env_vars.h" 111 #include "chrome/common/env_vars.h"
112 #include "chrome/common/features.h" 112 #include "chrome/common/features.h"
113 #include "chrome/common/logging_chrome.h" 113 #include "chrome/common/logging_chrome.h"
114 #include "chrome/common/media/media_resource_provider.h" 114 #include "chrome/common/media/media_resource_provider.h"
115 #include "chrome/common/net/net_resource_provider.h" 115 #include "chrome/common/net/net_resource_provider.h"
116 #include "chrome/common/pref_names.h" 116 #include "chrome/common/pref_names.h"
117 #include "chrome/common/profiling.h" 117 #include "chrome/common/profiling.h"
118 #include "chrome/common/stack_sampling_configuration.h" 118 #include "chrome/common/stack_sampling_configuration.h"
119 #include "chrome/common/variations/variations_util.h"
120 #include "chrome/grit/generated_resources.h" 119 #include "chrome/grit/generated_resources.h"
121 #include "chrome/installer/util/google_update_settings.h" 120 #include "chrome/installer/util/google_update_settings.h"
122 #include "components/component_updater/component_updater_service.h" 121 #include "components/component_updater/component_updater_service.h"
123 #include "components/device_event_log/device_event_log.h" 122 #include "components/device_event_log/device_event_log.h"
124 #include "components/flags_ui/pref_service_flags_storage.h" 123 #include "components/flags_ui/pref_service_flags_storage.h"
125 #include "components/google/core/browser/google_util.h" 124 #include "components/google/core/browser/google_util.h"
126 #include "components/language_usage_metrics/language_usage_metrics.h" 125 #include "components/language_usage_metrics/language_usage_metrics.h"
127 #include "components/metrics/call_stack_profile_metrics_provider.h" 126 #include "components/metrics/call_stack_profile_metrics_provider.h"
128 #include "components/metrics/metrics_reporting_default_state.h" 127 #include "components/metrics/metrics_reporting_default_state.h"
129 #include "components/metrics/metrics_service.h" 128 #include "components/metrics/metrics_service.h"
130 #include "components/metrics/profiler/content/content_tracking_synchronizer_dele gate.h" 129 #include "components/metrics/profiler/content/content_tracking_synchronizer_dele gate.h"
131 #include "components/metrics/profiler/tracking_synchronizer.h" 130 #include "components/metrics/profiler/tracking_synchronizer.h"
132 #include "components/metrics_services_manager/metrics_services_manager.h" 131 #include "components/metrics_services_manager/metrics_services_manager.h"
133 #include "components/nacl/browser/nacl_browser.h" 132 #include "components/nacl/browser/nacl_browser.h"
134 #include "components/prefs/json_pref_store.h" 133 #include "components/prefs/json_pref_store.h"
135 #include "components/prefs/pref_registry_simple.h" 134 #include "components/prefs/pref_registry_simple.h"
136 #include "components/prefs/pref_service.h" 135 #include "components/prefs/pref_service.h"
137 #include "components/prefs/pref_value_store.h" 136 #include "components/prefs/pref_value_store.h"
138 #include "components/prefs/scoped_user_pref_update.h" 137 #include "components/prefs/scoped_user_pref_update.h"
139 #include "components/rappor/rappor_service.h" 138 #include "components/rappor/rappor_service.h"
140 #include "components/signin/core/common/profile_management_switches.h" 139 #include "components/signin/core/common/profile_management_switches.h"
141 #include "components/startup_metric_utils/browser/startup_metric_utils.h" 140 #include "components/startup_metric_utils/browser/startup_metric_utils.h"
142 #include "components/task_scheduler_util/initialization_util.h" 141 #include "components/task_scheduler_util/initialization_util.h"
143 #include "components/tracing/common/tracing_switches.h" 142 #include "components/tracing/common/tracing_switches.h"
144 #include "components/translate/core/browser/translate_download_manager.h" 143 #include "components/translate/core/browser/translate_download_manager.h"
144 #include "components/variations/fieldtrial_util.h"
145 #include "components/variations/pref_names.h" 145 #include "components/variations/pref_names.h"
146 #include "components/variations/service/variations_service.h" 146 #include "components/variations/service/variations_service.h"
147 #include "components/variations/variations_associated_data.h" 147 #include "components/variations/variations_associated_data.h"
148 #include "components/variations/variations_http_header_provider.h" 148 #include "components/variations/variations_http_header_provider.h"
149 #include "components/variations/variations_switches.h" 149 #include "components/variations/variations_switches.h"
150 #include "components/version_info/version_info.h" 150 #include "components/version_info/version_info.h"
151 #include "content/public/browser/browser_thread.h" 151 #include "content/public/browser/browser_thread.h"
152 #include "content/public/browser/notification_observer.h" 152 #include "content/public/browser/notification_observer.h"
153 #include "content/public/browser/notification_registrar.h" 153 #include "content/public/browser/notification_registrar.h"
154 #include "content/public/browser/notification_service.h" 154 #include "content/public/browser/notification_service.h"
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 ->CreateEntropyProvider())); 690 ->CreateEntropyProvider()));
691 691
692 const base::CommandLine* command_line = 692 const base::CommandLine* command_line =
693 base::CommandLine::ForCurrentProcess(); 693 base::CommandLine::ForCurrentProcess();
694 if (command_line->HasSwitch(switches::kEnableBenchmarking) || 694 if (command_line->HasSwitch(switches::kEnableBenchmarking) ||
695 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { 695 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) {
696 base::FieldTrial::EnableBenchmarking(); 696 base::FieldTrial::EnableBenchmarking();
697 } 697 }
698 698
699 if (command_line->HasSwitch(switches::kForceFieldTrialParams)) { 699 if (command_line->HasSwitch(switches::kForceFieldTrialParams)) {
700 bool result = chrome_variations::AssociateParamsFromString( 700 bool result = variations::AssociateParamsFromString(
701 command_line->GetSwitchValueASCII(switches::kForceFieldTrialParams)); 701 command_line->GetSwitchValueASCII(switches::kForceFieldTrialParams));
702 CHECK(result) << "Invalid --" << switches::kForceFieldTrialParams 702 CHECK(result) << "Invalid --" << switches::kForceFieldTrialParams
703 << " list specified."; 703 << " list specified.";
704 } 704 }
705 705
706 // Ensure any field trials specified on the command line are initialized. 706 // Ensure any field trials specified on the command line are initialized.
707 if (command_line->HasSwitch(switches::kForceFieldTrials)) { 707 if (command_line->HasSwitch(switches::kForceFieldTrials)) {
708 std::set<std::string> unforceable_field_trials; 708 std::set<std::string> unforceable_field_trials;
709 #if defined(OFFICIAL_BUILD) 709 #if defined(OFFICIAL_BUILD)
710 unforceable_field_trials.insert("SettingsEnforcement"); 710 unforceable_field_trials.insert("SettingsEnforcement");
(...skipping 28 matching lines...) Expand all
739 << switches::kForceVariationIds << " or in chrome://flags)"; 739 << switches::kForceVariationIds << " or in chrome://flags)";
740 740
741 feature_list->InitializeFromCommandLine( 741 feature_list->InitializeFromCommandLine(
742 command_line->GetSwitchValueASCII(switches::kEnableFeatures), 742 command_line->GetSwitchValueASCII(switches::kEnableFeatures),
743 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); 743 command_line->GetSwitchValueASCII(switches::kDisableFeatures));
744 744
745 #if defined(FIELDTRIAL_TESTING_ENABLED) 745 #if defined(FIELDTRIAL_TESTING_ENABLED)
746 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && 746 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) &&
747 !command_line->HasSwitch(switches::kForceFieldTrials) && 747 !command_line->HasSwitch(switches::kForceFieldTrials) &&
748 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { 748 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) {
749 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); 749 variations::AssociateDefaultFieldTrialConfig(feature_list.get());
750 } 750 }
751 #endif // defined(FIELDTRIAL_TESTING_ENABLED) 751 #endif // defined(FIELDTRIAL_TESTING_ENABLED)
752 752
753 variations::VariationsService* variations_service = 753 variations::VariationsService* variations_service =
754 browser_process_->variations_service(); 754 browser_process_->variations_service();
755 755
756 bool has_seed = variations_service && 756 bool has_seed = variations_service &&
757 variations_service->CreateTrialsFromSeed(feature_list.get()); 757 variations_service->CreateTrialsFromSeed(feature_list.get());
758 758
759 browser_field_trials_.SetupFeatureControllingFieldTrials(has_seed, 759 browser_field_trials_.SetupFeatureControllingFieldTrials(has_seed,
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 chromeos::CrosSettings::Shutdown(); 2111 chromeos::CrosSettings::Shutdown();
2112 #endif // defined(OS_CHROMEOS) 2112 #endif // defined(OS_CHROMEOS)
2113 #endif // defined(OS_ANDROID) 2113 #endif // defined(OS_ANDROID)
2114 } 2114 }
2115 2115
2116 // Public members: 2116 // Public members:
2117 2117
2118 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2118 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2119 chrome_extra_parts_.push_back(parts); 2119 chrome_extra_parts_.push_back(parts);
2120 } 2120 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698