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 <map> | 10 #include <map> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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/field_trial_config/field_trial_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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 new base::FieldTrialList(browser_process_->GetMetricsServicesManager() | 689 new base::FieldTrialList(browser_process_->GetMetricsServicesManager() |
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(variations::switches::kForceFieldTrialParams)) { |
700 bool result = chrome_variations::AssociateParamsFromString( | 700 bool result = variations::AssociateParamsFromString( |
701 command_line->GetSwitchValueASCII(switches::kForceFieldTrialParams)); | 701 command_line->GetSwitchValueASCII( |
702 CHECK(result) << "Invalid --" << switches::kForceFieldTrialParams | 702 variations::switches::kForceFieldTrialParams)); |
| 703 CHECK(result) << "Invalid --" |
| 704 << variations::switches::kForceFieldTrialParams |
703 << " list specified."; | 705 << " list specified."; |
704 } | 706 } |
705 | 707 |
706 // Ensure any field trials specified on the command line are initialized. | 708 // Ensure any field trials specified on the command line are initialized. |
707 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 709 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
708 std::set<std::string> unforceable_field_trials; | 710 std::set<std::string> unforceable_field_trials; |
709 #if defined(OFFICIAL_BUILD) | 711 #if defined(OFFICIAL_BUILD) |
710 unforceable_field_trials.insert("SettingsEnforcement"); | 712 unforceable_field_trials.insert("SettingsEnforcement"); |
711 #endif // defined(OFFICIAL_BUILD) | 713 #endif // defined(OFFICIAL_BUILD) |
712 | 714 |
(...skipping 23 matching lines...) Expand all Loading... |
736 command_line->GetSwitchValueASCII(switches::kForceVariationIds), | 738 command_line->GetSwitchValueASCII(switches::kForceVariationIds), |
737 &variation_ids); | 739 &variation_ids); |
738 CHECK(result) << "Invalid list of variation ids specified (either in --" | 740 CHECK(result) << "Invalid list of variation ids specified (either in --" |
739 << switches::kForceVariationIds << " or in chrome://flags)"; | 741 << switches::kForceVariationIds << " or in chrome://flags)"; |
740 | 742 |
741 feature_list->InitializeFromCommandLine( | 743 feature_list->InitializeFromCommandLine( |
742 command_line->GetSwitchValueASCII(switches::kEnableFeatures), | 744 command_line->GetSwitchValueASCII(switches::kEnableFeatures), |
743 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); | 745 command_line->GetSwitchValueASCII(switches::kDisableFeatures)); |
744 | 746 |
745 #if defined(FIELDTRIAL_TESTING_ENABLED) | 747 #if defined(FIELDTRIAL_TESTING_ENABLED) |
746 if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) && | 748 if (!command_line->HasSwitch( |
| 749 variations::switches::kDisableFieldTrialTestingConfig) && |
747 !command_line->HasSwitch(switches::kForceFieldTrials) && | 750 !command_line->HasSwitch(switches::kForceFieldTrials) && |
748 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { | 751 !command_line->HasSwitch(variations::switches::kVariationsServerURL)) { |
749 chrome_variations::AssociateDefaultFieldTrialConfig(feature_list.get()); | 752 variations::AssociateDefaultFieldTrialConfig(feature_list.get()); |
750 } | 753 } |
751 #endif // defined(FIELDTRIAL_TESTING_ENABLED) | 754 #endif // defined(FIELDTRIAL_TESTING_ENABLED) |
752 | 755 |
753 variations::VariationsService* variations_service = | 756 variations::VariationsService* variations_service = |
754 browser_process_->variations_service(); | 757 browser_process_->variations_service(); |
755 | 758 |
756 bool has_seed = variations_service && | 759 bool has_seed = variations_service && |
757 variations_service->CreateTrialsFromSeed(feature_list.get()); | 760 variations_service->CreateTrialsFromSeed(feature_list.get()); |
758 | 761 |
759 browser_field_trials_.SetupFeatureControllingFieldTrials(has_seed, | 762 browser_field_trials_.SetupFeatureControllingFieldTrials(has_seed, |
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 chromeos::CrosSettings::Shutdown(); | 2114 chromeos::CrosSettings::Shutdown(); |
2112 #endif // defined(OS_CHROMEOS) | 2115 #endif // defined(OS_CHROMEOS) |
2113 #endif // defined(OS_ANDROID) | 2116 #endif // defined(OS_ANDROID) |
2114 } | 2117 } |
2115 | 2118 |
2116 // Public members: | 2119 // Public members: |
2117 | 2120 |
2118 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2121 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
2119 chrome_extra_parts_.push_back(parts); | 2122 chrome_extra_parts_.push_back(parts); |
2120 } | 2123 } |
OLD | NEW |