| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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/network_time/network_time_tracker.h" | 81 #include "components/network_time/network_time_tracker.h" |
| 82 #include "components/policy/core/common/policy_service.h" | 82 #include "components/policy/core/common/policy_service.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/web_resource_pref_names.h" | 87 #include "components/web_resource/web_resource_pref_names.h" |
| 87 #include "content/public/browser/browser_thread.h" | 88 #include "content/public/browser/browser_thread.h" |
| 88 #include "content/public/browser/child_process_security_policy.h" | 89 #include "content/public/browser/child_process_security_policy.h" |
| 89 #include "content/public/browser/notification_details.h" | 90 #include "content/public/browser/notification_details.h" |
| 90 #include "content/public/browser/plugin_service.h" | 91 #include "content/public/browser/plugin_service.h" |
| 91 #include "content/public/browser/render_process_host.h" | 92 #include "content/public/browser/render_process_host.h" |
| 92 #include "content/public/browser/resource_dispatcher_host.h" | 93 #include "content/public/browser/resource_dispatcher_host.h" |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 DCHECK(!plugins_resource_service_.get()); | 1062 DCHECK(!plugins_resource_service_.get()); |
| 1062 plugins_resource_service_.reset(new PluginsResourceService(local_state())); | 1063 plugins_resource_service_.reset(new PluginsResourceService(local_state())); |
| 1063 plugins_resource_service_->Init(); | 1064 plugins_resource_service_->Init(); |
| 1064 #endif | 1065 #endif |
| 1065 #endif // defined(ENABLE_PLUGINS) | 1066 #endif // defined(ENABLE_PLUGINS) |
| 1066 | 1067 |
| 1067 const base::CommandLine& command_line = | 1068 const base::CommandLine& command_line = |
| 1068 *base::CommandLine::ForCurrentProcess(); | 1069 *base::CommandLine::ForCurrentProcess(); |
| 1069 if (!command_line.HasSwitch(switches::kDisableWebResources)) { | 1070 if (!command_line.HasSwitch(switches::kDisableWebResources)) { |
| 1070 DCHECK(!promo_resource_service_.get()); | 1071 DCHECK(!promo_resource_service_.get()); |
| 1071 promo_resource_service_.reset( | 1072 promo_resource_service_.reset(new PromoResourceService( |
| 1072 new PromoResourceService(local_state(), chrome::GetChannel())); | 1073 local_state(), chrome::GetChannel(), GetApplicationLocale(), |
| 1074 system_request_context(), switches::kDisableBackgroundNetworking, |
| 1075 base::Bind(safe_json::SafeJsonParser::Parse))); |
| 1073 promo_resource_service_->StartAfterDelay(); | 1076 promo_resource_service_->StartAfterDelay(); |
| 1074 } | 1077 } |
| 1075 | 1078 |
| 1076 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 1079 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 1077 storage_monitor::StorageMonitor::Create(); | 1080 storage_monitor::StorageMonitor::Create(); |
| 1078 #endif | 1081 #endif |
| 1079 | 1082 |
| 1080 child_process_watcher_.reset(new ChromeChildProcessWatcher()); | 1083 child_process_watcher_.reset(new ChromeChildProcessWatcher()); |
| 1081 | 1084 |
| 1082 CacheDefaultWebClientState(); | 1085 CacheDefaultWebClientState(); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 } | 1255 } |
| 1253 | 1256 |
| 1254 void BrowserProcessImpl::OnAutoupdateTimer() { | 1257 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1255 if (CanAutorestartForUpdate()) { | 1258 if (CanAutorestartForUpdate()) { |
| 1256 DLOG(WARNING) << "Detected update. Restarting browser."; | 1259 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1257 RestartBackgroundInstance(); | 1260 RestartBackgroundInstance(); |
| 1258 } | 1261 } |
| 1259 } | 1262 } |
| 1260 | 1263 |
| 1261 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1264 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |