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