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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 #include "chrome/common/chrome_paths.h" | 96 #include "chrome/common/chrome_paths.h" |
97 #include "chrome/common/chrome_result_codes.h" | 97 #include "chrome/common/chrome_result_codes.h" |
98 #include "chrome/common/chrome_switches.h" | 98 #include "chrome/common/chrome_switches.h" |
99 #include "chrome/common/chrome_version_info.h" | 99 #include "chrome/common/chrome_version_info.h" |
100 #include "chrome/common/crash_keys.h" | 100 #include "chrome/common/crash_keys.h" |
101 #include "chrome/common/env_vars.h" | 101 #include "chrome/common/env_vars.h" |
102 #include "chrome/common/logging_chrome.h" | 102 #include "chrome/common/logging_chrome.h" |
103 #include "chrome/common/net/net_resource_provider.h" | 103 #include "chrome/common/net/net_resource_provider.h" |
104 #include "chrome/common/pref_names.h" | 104 #include "chrome/common/pref_names.h" |
105 #include "chrome/common/profiling.h" | 105 #include "chrome/common/profiling.h" |
| 106 #include "chrome/common/variations/variations_util.h" |
106 #include "chrome/grit/generated_resources.h" | 107 #include "chrome/grit/generated_resources.h" |
107 #include "chrome/installer/util/google_update_settings.h" | 108 #include "chrome/installer/util/google_update_settings.h" |
108 #include "components/component_updater/component_updater_service.h" | 109 #include "components/component_updater/component_updater_service.h" |
109 #include "components/device_event_log/device_event_log.h" | 110 #include "components/device_event_log/device_event_log.h" |
110 #include "components/google/core/browser/google_util.h" | 111 #include "components/google/core/browser/google_util.h" |
111 #include "components/language_usage_metrics/language_usage_metrics.h" | 112 #include "components/language_usage_metrics/language_usage_metrics.h" |
112 #include "components/metrics/call_stack_profile_metrics_provider.h" | 113 #include "components/metrics/call_stack_profile_metrics_provider.h" |
113 #include "components/metrics/metrics_service.h" | 114 #include "components/metrics/metrics_service.h" |
114 #include "components/metrics/profiler/tracking_synchronizer.h" | 115 #include "components/metrics/profiler/tracking_synchronizer.h" |
115 #include "components/nacl/browser/nacl_browser.h" | 116 #include "components/nacl/browser/nacl_browser.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 field_trial_list_.reset( | 631 field_trial_list_.reset( |
631 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); | 632 new base::FieldTrialList(metrics->CreateEntropyProvider().release())); |
632 | 633 |
633 const base::CommandLine* command_line = | 634 const base::CommandLine* command_line = |
634 base::CommandLine::ForCurrentProcess(); | 635 base::CommandLine::ForCurrentProcess(); |
635 if (command_line->HasSwitch(switches::kEnableBenchmarking) || | 636 if (command_line->HasSwitch(switches::kEnableBenchmarking) || |
636 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { | 637 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)) { |
637 base::FieldTrial::EnableBenchmarking(); | 638 base::FieldTrial::EnableBenchmarking(); |
638 } | 639 } |
639 | 640 |
| 641 if (command_line->HasSwitch(switches::kForceFieldTrialParams)) { |
| 642 bool result = chrome_variations::AssociateParamsFromString( |
| 643 command_line->GetSwitchValueASCII(switches::kForceFieldTrialParams)); |
| 644 CHECK(result) << "Invalid --" << switches::kForceFieldTrialParams |
| 645 << " list specified."; |
| 646 } |
| 647 |
640 // Ensure any field trials specified on the command line are initialized. | 648 // Ensure any field trials specified on the command line are initialized. |
641 if (command_line->HasSwitch(switches::kForceFieldTrials)) { | 649 if (command_line->HasSwitch(switches::kForceFieldTrials)) { |
642 std::set<std::string> unforceable_field_trials; | 650 std::set<std::string> unforceable_field_trials; |
643 #if defined(OFFICIAL_BUILD) | 651 #if defined(OFFICIAL_BUILD) |
644 unforceable_field_trials.insert("SettingsEnforcement"); | 652 unforceable_field_trials.insert("SettingsEnforcement"); |
645 #endif // defined(OFFICIAL_BUILD) | 653 #endif // defined(OFFICIAL_BUILD) |
646 | 654 |
647 // Create field trials without activating them, so that this behaves in a | 655 // Create field trials without activating them, so that this behaves in a |
648 // consistent manner with field trials created from the server. | 656 // consistent manner with field trials created from the server. |
649 bool result = base::FieldTrialList::CreateTrialsFromString( | 657 bool result = base::FieldTrialList::CreateTrialsFromString( |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 chromeos::CrosSettings::Shutdown(); | 1778 chromeos::CrosSettings::Shutdown(); |
1771 #endif // defined(OS_CHROMEOS) | 1779 #endif // defined(OS_CHROMEOS) |
1772 #endif // defined(OS_ANDROID) | 1780 #endif // defined(OS_ANDROID) |
1773 } | 1781 } |
1774 | 1782 |
1775 // Public members: | 1783 // Public members: |
1776 | 1784 |
1777 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1785 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1778 chrome_extra_parts_.push_back(parts); | 1786 chrome_extra_parts_.push_back(parts); |
1779 } | 1787 } |
OLD | NEW |