| 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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/first_run/upgrade_util.h" | 39 #include "chrome/browser/first_run/upgrade_util.h" |
| 40 #include "chrome/browser/gpu/gl_string_manager.h" | 40 #include "chrome/browser/gpu/gl_string_manager.h" |
| 41 #include "chrome/browser/gpu/gpu_mode_manager.h" | 41 #include "chrome/browser/gpu/gpu_mode_manager.h" |
| 42 #include "chrome/browser/icon_manager.h" | 42 #include "chrome/browser/icon_manager.h" |
| 43 #include "chrome/browser/intranet_redirect_detector.h" | 43 #include "chrome/browser/intranet_redirect_detector.h" |
| 44 #include "chrome/browser/io_thread.h" | 44 #include "chrome/browser/io_thread.h" |
| 45 #include "chrome/browser/lifetime/application_lifetime.h" | 45 #include "chrome/browser/lifetime/application_lifetime.h" |
| 46 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 46 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 47 #include "chrome/browser/metrics/metrics_services_manager.h" | 47 #include "chrome/browser/metrics/metrics_services_manager.h" |
| 48 #include "chrome/browser/metrics/thread_watcher.h" | 48 #include "chrome/browser/metrics/thread_watcher.h" |
| 49 #include "chrome/browser/net/chrome_net_log.h" | 49 #include "chrome/browser/net/chrome_net_log_helper.h" |
| 50 #include "chrome/browser/net/crl_set_fetcher.h" | 50 #include "chrome/browser/net/crl_set_fetcher.h" |
| 51 #include "chrome/browser/notifications/notification_ui_manager.h" | 51 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 52 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 52 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
| 53 #include "chrome/browser/plugins/plugin_finder.h" | 53 #include "chrome/browser/plugins/plugin_finder.h" |
| 54 #include "chrome/browser/prefs/browser_prefs.h" | 54 #include "chrome/browser/prefs/browser_prefs.h" |
| 55 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 55 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 56 #include "chrome/browser/printing/background_printing_manager.h" | 56 #include "chrome/browser/printing/background_printing_manager.h" |
| 57 #include "chrome/browser/printing/print_job_manager.h" | 57 #include "chrome/browser/printing/print_job_manager.h" |
| 58 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 58 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 59 #include "chrome/browser/profiles/profile_manager.h" | 59 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 #include "chrome/common/chrome_switches.h" | 71 #include "chrome/common/chrome_switches.h" |
| 72 #include "chrome/common/extensions/chrome_extensions_client.h" | 72 #include "chrome/common/extensions/chrome_extensions_client.h" |
| 73 #include "chrome/common/pref_names.h" | 73 #include "chrome/common/pref_names.h" |
| 74 #include "chrome/common/switch_utils.h" | 74 #include "chrome/common/switch_utils.h" |
| 75 #include "chrome/common/url_constants.h" | 75 #include "chrome/common/url_constants.h" |
| 76 #include "chrome/installer/util/google_update_constants.h" | 76 #include "chrome/installer/util/google_update_constants.h" |
| 77 #include "chrome/installer/util/google_update_settings.h" | 77 #include "chrome/installer/util/google_update_settings.h" |
| 78 #include "components/component_updater/component_updater_service.h" | 78 #include "components/component_updater/component_updater_service.h" |
| 79 #include "components/gcm_driver/gcm_driver.h" | 79 #include "components/gcm_driver/gcm_driver.h" |
| 80 #include "components/metrics/metrics_service.h" | 80 #include "components/metrics/metrics_service.h" |
| 81 #include "components/net_log/chrome_net_log.h" |
| 81 #include "components/network_time/network_time_tracker.h" | 82 #include "components/network_time/network_time_tracker.h" |
| 82 #include "components/policy/core/common/policy_service.h" | 83 #include "components/policy/core/common/policy_service.h" |
| 83 #include "components/safe_json/safe_json_parser.h" | 84 #include "components/safe_json/safe_json_parser.h" |
| 84 #include "components/signin/core/common/profile_management_switches.h" | 85 #include "components/signin/core/common/profile_management_switches.h" |
| 85 #include "components/translate/core/browser/translate_download_manager.h" | 86 #include "components/translate/core/browser/translate_download_manager.h" |
| 86 #include "components/update_client/update_query_params.h" | 87 #include "components/update_client/update_query_params.h" |
| 87 #include "components/web_resource/promo_resource_service.h" | 88 #include "components/web_resource/promo_resource_service.h" |
| 88 #include "components/web_resource/web_resource_pref_names.h" | 89 #include "components/web_resource/web_resource_pref_names.h" |
| 89 #include "content/public/browser/browser_thread.h" | 90 #include "content/public/browser/browser_thread.h" |
| 90 #include "content/public/browser/child_process_security_policy.h" | 91 #include "content/public/browser/child_process_security_policy.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 local_state_task_runner_(local_state_task_runner), | 186 local_state_task_runner_(local_state_task_runner), |
| 186 cached_default_web_client_state_(ShellIntegration::UNKNOWN_DEFAULT) { | 187 cached_default_web_client_state_(ShellIntegration::UNKNOWN_DEFAULT) { |
| 187 g_browser_process = this; | 188 g_browser_process = this; |
| 188 platform_part_.reset(new BrowserProcessPlatformPart()); | 189 platform_part_.reset(new BrowserProcessPlatformPart()); |
| 189 | 190 |
| 190 #if defined(ENABLE_PRINTING) | 191 #if defined(ENABLE_PRINTING) |
| 191 // Must be created after the NotificationService. | 192 // Must be created after the NotificationService. |
| 192 print_job_manager_.reset(new printing::PrintJobManager); | 193 print_job_manager_.reset(new printing::PrintJobManager); |
| 193 #endif | 194 #endif |
| 194 | 195 |
| 195 net_log_.reset(new ChromeNetLog); | 196 base::FilePath net_log_path; |
| 197 if (command_line.HasSwitch(switches::kLogNetLog)) |
| 198 net_log_path = command_line.GetSwitchValuePath(switches::kLogNetLog); |
| 199 net_log_.reset(new net_log::ChromeNetLog( |
| 200 net_log_path, GetNetCaptureModeFromCommandLine(command_line), |
| 201 command_line.GetCommandLineString(), chrome::GetChannelString())); |
| 196 | 202 |
| 197 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 203 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
| 198 extensions::kExtensionScheme); | 204 extensions::kExtensionScheme); |
| 199 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 205 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
| 200 extensions::kExtensionResourceScheme); | 206 extensions::kExtensionResourceScheme); |
| 201 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | 207 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( |
| 202 chrome::kChromeSearchScheme); | 208 chrome::kChromeSearchScheme); |
| 203 | 209 |
| 204 #if defined(OS_MACOSX) | 210 #if defined(OS_MACOSX) |
| 205 ui::InitIdleMonitor(); | 211 ui::InitIdleMonitor(); |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 | 884 |
| 879 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 885 #if (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| 880 void BrowserProcessImpl::StartAutoupdateTimer() { | 886 void BrowserProcessImpl::StartAutoupdateTimer() { |
| 881 autoupdate_timer_.Start(FROM_HERE, | 887 autoupdate_timer_.Start(FROM_HERE, |
| 882 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), | 888 base::TimeDelta::FromHours(kUpdateCheckIntervalHours), |
| 883 this, | 889 this, |
| 884 &BrowserProcessImpl::OnAutoupdateTimer); | 890 &BrowserProcessImpl::OnAutoupdateTimer); |
| 885 } | 891 } |
| 886 #endif | 892 #endif |
| 887 | 893 |
| 888 ChromeNetLog* BrowserProcessImpl::net_log() { | 894 net_log::ChromeNetLog* BrowserProcessImpl::net_log() { |
| 889 return net_log_.get(); | 895 return net_log_.get(); |
| 890 } | 896 } |
| 891 | 897 |
| 892 component_updater::ComponentUpdateService* | 898 component_updater::ComponentUpdateService* |
| 893 BrowserProcessImpl::component_updater() { | 899 BrowserProcessImpl::component_updater() { |
| 894 if (!component_updater_.get()) { | 900 if (!component_updater_.get()) { |
| 895 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) | 901 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) |
| 896 return NULL; | 902 return NULL; |
| 897 scoped_refptr<update_client::Configurator> configurator = | 903 scoped_refptr<update_client::Configurator> configurator = |
| 898 component_updater::MakeChromeComponentUpdaterConfigurator( | 904 component_updater::MakeChromeComponentUpdaterConfigurator( |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 } | 1263 } |
| 1258 | 1264 |
| 1259 void BrowserProcessImpl::OnAutoupdateTimer() { | 1265 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1260 if (CanAutorestartForUpdate()) { | 1266 if (CanAutorestartForUpdate()) { |
| 1261 DLOG(WARNING) << "Detected update. Restarting browser."; | 1267 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1262 RestartBackgroundInstance(); | 1268 RestartBackgroundInstance(); |
| 1263 } | 1269 } |
| 1264 } | 1270 } |
| 1265 | 1271 |
| 1266 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1272 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |