| 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_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 #include "components/prefs/pref_service.h" | 139 #include "components/prefs/pref_service.h" |
| 140 #include "components/prefs/scoped_user_pref_update.h" | 140 #include "components/prefs/scoped_user_pref_update.h" |
| 141 #include "components/rappor/public/rappor_utils.h" | 141 #include "components/rappor/public/rappor_utils.h" |
| 142 #include "components/rappor/rappor_recorder_impl.h" | 142 #include "components/rappor/rappor_recorder_impl.h" |
| 143 #include "components/rappor/rappor_service_impl.h" | 143 #include "components/rappor/rappor_service_impl.h" |
| 144 #include "components/security_interstitials/core/ssl_error_ui.h" | 144 #include "components/security_interstitials/core/ssl_error_ui.h" |
| 145 #include "components/signin/core/common/profile_management_switches.h" | 145 #include "components/signin/core/common/profile_management_switches.h" |
| 146 #include "components/spellcheck/spellcheck_build_features.h" | 146 #include "components/spellcheck/spellcheck_build_features.h" |
| 147 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" | 147 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" |
| 148 #include "components/task_scheduler_util/browser/initialization.h" | 148 #include "components/task_scheduler_util/browser/initialization.h" |
| 149 #include "components/task_scheduler_util/common/variations_util.h" |
| 149 #include "components/translate/core/common/translate_switches.h" | 150 #include "components/translate/core/common/translate_switches.h" |
| 150 #include "components/url_formatter/url_fixer.h" | 151 #include "components/url_formatter/url_fixer.h" |
| 151 #include "components/variations/variations_associated_data.h" | 152 #include "components/variations/variations_associated_data.h" |
| 152 #include "components/version_info/version_info.h" | 153 #include "components/version_info/version_info.h" |
| 153 #include "content/public/browser/browser_child_process_host.h" | 154 #include "content/public/browser/browser_child_process_host.h" |
| 154 #include "content/public/browser/browser_main_parts.h" | 155 #include "content/public/browser/browser_main_parts.h" |
| 155 #include "content/public/browser/browser_ppapi_host.h" | 156 #include "content/public/browser/browser_ppapi_host.h" |
| 156 #include "content/public/browser/browser_thread.h" | 157 #include "content/public/browser/browser_thread.h" |
| 157 #include "content/public/browser/browser_url_handler.h" | 158 #include "content/public/browser/browser_url_handler.h" |
| 158 #include "content/public/browser/child_process_data.h" | 159 #include "content/public/browser/child_process_data.h" |
| (...skipping 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 | 1817 |
| 1817 // The command line switch kEnableBenchmarking needs to be specified along | 1818 // The command line switch kEnableBenchmarking needs to be specified along |
| 1818 // with the kEnableStatsTable switch to ensure that the stats table global | 1819 // with the kEnableStatsTable switch to ensure that the stats table global |
| 1819 // is initialized correctly. | 1820 // is initialized correctly. |
| 1820 if (command_line->HasSwitch(switches::kEnableBenchmarking)) | 1821 if (command_line->HasSwitch(switches::kEnableBenchmarking)) |
| 1821 DCHECK(command_line->HasSwitch(switches::kEnableStatsTable)); | 1822 DCHECK(command_line->HasSwitch(switches::kEnableStatsTable)); |
| 1822 | 1823 |
| 1823 StackSamplingConfiguration::Get()->AppendCommandLineSwitchForChildProcess( | 1824 StackSamplingConfiguration::Get()->AppendCommandLineSwitchForChildProcess( |
| 1824 process_type, | 1825 process_type, |
| 1825 command_line); | 1826 command_line); |
| 1827 |
| 1828 if (process_type == switches::kRendererProcess) { |
| 1829 std::map<std::string, std::string> task_scheduler_variation_params; |
| 1830 if (variations::GetVariationParams("BrowserScheduler", |
| 1831 &task_scheduler_variation_params)) { |
| 1832 task_scheduler_util::AddVariationParamsToCommandLine( |
| 1833 task_scheduler_variation_params, "Renderer", command_line); |
| 1834 } |
| 1835 } |
| 1826 } | 1836 } |
| 1827 | 1837 |
| 1828 std::string ChromeContentBrowserClient::GetApplicationLocale() { | 1838 std::string ChromeContentBrowserClient::GetApplicationLocale() { |
| 1829 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) | 1839 if (BrowserThread::CurrentlyOn(BrowserThread::IO)) |
| 1830 return g_io_thread_application_locale.Get(); | 1840 return g_io_thread_application_locale.Get(); |
| 1831 return g_browser_process->GetApplicationLocale(); | 1841 return g_browser_process->GetApplicationLocale(); |
| 1832 } | 1842 } |
| 1833 | 1843 |
| 1834 std::string ChromeContentBrowserClient::GetAcceptLangs( | 1844 std::string ChromeContentBrowserClient::GetAcceptLangs( |
| 1835 content::BrowserContext* context) { | 1845 content::BrowserContext* context) { |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3351 } | 3361 } |
| 3352 | 3362 |
| 3353 void ChromeContentBrowserClient:: | 3363 void ChromeContentBrowserClient:: |
| 3354 PerformExperimentalTaskSchedulerRedirections() { | 3364 PerformExperimentalTaskSchedulerRedirections() { |
| 3355 std::map<std::string, std::string> variation_params; | 3365 std::map<std::string, std::string> variation_params; |
| 3356 if (variations::GetVariationParams("BrowserScheduler", &variation_params)) { | 3366 if (variations::GetVariationParams("BrowserScheduler", &variation_params)) { |
| 3357 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection( | 3367 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection( |
| 3358 variation_params); | 3368 variation_params); |
| 3359 } | 3369 } |
| 3360 } | 3370 } |
| OLD | NEW |