| 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/profiles/profile_io_data.h" | 5 #include "chrome/browser/profiles/profile_io_data.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/io_thread.h" | 34 #include "chrome/browser/io_thread.h" |
| 35 #include "chrome/browser/media/media_device_id_salt.h" | 35 #include "chrome/browser/media/media_device_id_salt.h" |
| 36 #include "chrome/browser/net/about_protocol_handler.h" | 36 #include "chrome/browser/net/about_protocol_handler.h" |
| 37 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" | 37 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
| 38 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 38 #include "chrome/browser/net/chrome_http_user_agent_settings.h" |
| 39 #include "chrome/browser/net/chrome_net_log.h" | 39 #include "chrome/browser/net/chrome_net_log.h" |
| 40 #include "chrome/browser/net/chrome_network_delegate.h" | 40 #include "chrome/browser/net/chrome_network_delegate.h" |
| 41 #include "chrome/browser/net/chrome_url_request_context_getter.h" | 41 #include "chrome/browser/net/chrome_url_request_context_getter.h" |
| 42 #include "chrome/browser/net/cookie_store_util.h" | 42 #include "chrome/browser/net/cookie_store_util.h" |
| 43 #include "chrome/browser/net/proxy_service_factory.h" | 43 #include "chrome/browser/net/proxy_service_factory.h" |
| 44 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" |
| 45 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 46 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 44 #include "chrome/browser/profiles/profile.h" | 47 #include "chrome/browser/profiles/profile.h" |
| 45 #include "chrome/browser/profiles/profile_manager.h" | 48 #include "chrome/browser/profiles/profile_manager.h" |
| 46 #include "chrome/browser/signin/signin_names_io_thread.h" | 49 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 47 #include "chrome/common/chrome_paths.h" | 50 #include "chrome/common/chrome_paths.h" |
| 48 #include "chrome/common/chrome_switches.h" | 51 #include "chrome/common/chrome_switches.h" |
| 49 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
| 50 #include "chrome/common/url_constants.h" | 53 #include "chrome/common/url_constants.h" |
| 51 #include "components/content_settings/core/browser/content_settings_provider.h" | 54 #include "components/content_settings/core/browser/content_settings_provider.h" |
| 52 #include "components/dom_distiller/core/url_constants.h" | 55 #include "components/dom_distiller/core/url_constants.h" |
| 53 #include "components/startup_metric_utils/startup_metric_utils.h" | 56 #include "components/startup_metric_utils/startup_metric_utils.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); | 353 params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); |
| 351 params->host_content_settings_map = profile->GetHostContentSettingsMap(); | 354 params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
| 352 params->ssl_config_service = profile->GetSSLConfigService(); | 355 params->ssl_config_service = profile->GetSSLConfigService(); |
| 353 params->cookie_monster_delegate = | 356 params->cookie_monster_delegate = |
| 354 chrome_browser_net::CreateCookieDelegate(profile); | 357 chrome_browser_net::CreateCookieDelegate(profile); |
| 355 #if defined(ENABLE_EXTENSIONS) | 358 #if defined(ENABLE_EXTENSIONS) |
| 356 params->extension_info_map = | 359 params->extension_info_map = |
| 357 extensions::ExtensionSystem::Get(profile)->info_map(); | 360 extensions::ExtensionSystem::Get(profile)->info_map(); |
| 358 #endif | 361 #endif |
| 359 | 362 |
| 363 if (predictors::ResourcePrefetchPredictor* predictor = |
| 364 predictors::ResourcePrefetchPredictorFactory::GetForProfile( |
| 365 profile)) { |
| 366 resource_prefetch_predictor_observer_.reset( |
| 367 new chrome_browser_net::ResourcePrefetchPredictorObserver(predictor)); |
| 368 } |
| 369 |
| 360 ProtocolHandlerRegistry* protocol_handler_registry = | 370 ProtocolHandlerRegistry* protocol_handler_registry = |
| 361 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); | 371 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); |
| 362 DCHECK(protocol_handler_registry); | 372 DCHECK(protocol_handler_registry); |
| 363 | 373 |
| 364 // The profile instance is only available here in the InitializeOnUIThread | 374 // The profile instance is only available here in the InitializeOnUIThread |
| 365 // method, so we create the url job factory here, then save it for | 375 // method, so we create the url job factory here, then save it for |
| 366 // later delivery to the job factory in Init(). | 376 // later delivery to the job factory in Init(). |
| 367 params->protocol_handler_interceptor = | 377 params->protocol_handler_interceptor = |
| 368 protocol_handler_registry->CreateJobInterceptorFactory(); | 378 protocol_handler_registry->CreateJobInterceptorFactory(); |
| 369 | 379 |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 // Take ownership over these parameters. | 1057 // Take ownership over these parameters. |
| 1048 cookie_settings_ = profile_params_->cookie_settings; | 1058 cookie_settings_ = profile_params_->cookie_settings; |
| 1049 host_content_settings_map_ = profile_params_->host_content_settings_map; | 1059 host_content_settings_map_ = profile_params_->host_content_settings_map; |
| 1050 #if defined(ENABLE_EXTENSIONS) | 1060 #if defined(ENABLE_EXTENSIONS) |
| 1051 extension_info_map_ = profile_params_->extension_info_map; | 1061 extension_info_map_ = profile_params_->extension_info_map; |
| 1052 #endif | 1062 #endif |
| 1053 | 1063 |
| 1054 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 1064 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
| 1055 resource_context_->request_context_ = main_request_context_.get(); | 1065 resource_context_->request_context_ = main_request_context_.get(); |
| 1056 | 1066 |
| 1067 if (profile_params_->resource_prefetch_predictor_observer_) { |
| 1068 resource_prefetch_predictor_observer_.reset( |
| 1069 profile_params_->resource_prefetch_predictor_observer_.release()); |
| 1070 } |
| 1071 |
| 1057 #if defined(ENABLE_MANAGED_USERS) | 1072 #if defined(ENABLE_MANAGED_USERS) |
| 1058 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; | 1073 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; |
| 1059 #endif | 1074 #endif |
| 1060 | 1075 |
| 1061 #if defined(OS_CHROMEOS) | 1076 #if defined(OS_CHROMEOS) |
| 1062 username_hash_ = profile_params_->username_hash; | 1077 username_hash_ = profile_params_->username_hash; |
| 1063 use_system_key_slot_ = profile_params_->use_system_key_slot; | 1078 use_system_key_slot_ = profile_params_->use_system_key_slot; |
| 1064 if (use_system_key_slot_) | 1079 if (use_system_key_slot_) |
| 1065 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); | 1080 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); |
| 1066 | 1081 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 void ProfileIOData::SetCookieSettingsForTesting( | 1291 void ProfileIOData::SetCookieSettingsForTesting( |
| 1277 CookieSettings* cookie_settings) { | 1292 CookieSettings* cookie_settings) { |
| 1278 DCHECK(!cookie_settings_.get()); | 1293 DCHECK(!cookie_settings_.get()); |
| 1279 cookie_settings_ = cookie_settings; | 1294 cookie_settings_ = cookie_settings; |
| 1280 } | 1295 } |
| 1281 | 1296 |
| 1282 void ProfileIOData::set_signin_names_for_testing( | 1297 void ProfileIOData::set_signin_names_for_testing( |
| 1283 SigninNamesOnIOThread* signin_names) { | 1298 SigninNamesOnIOThread* signin_names) { |
| 1284 signin_names_.reset(signin_names); | 1299 signin_names_.reset(signin_names); |
| 1285 } | 1300 } |
| OLD | NEW |