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