| 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 30 matching lines...) Expand all Loading... |
| 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" | 45 #include "chrome/browser/net/resource_prefetch_predictor_observer.h" |
| 46 #include "chrome/browser/predictors/resource_prefetch_predictor.h" | 46 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" | 47 #include "chrome/browser/predictors/resource_prefetch_predictor_factory.h" |
| 48 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
| 49 #include "chrome/browser/profiles/profile_manager.h" | 49 #include "chrome/browser/profiles/profile_manager.h" |
| 50 #include "chrome/browser/signin/signin_names_io_thread.h" | 50 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 51 #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" |
| 52 #include "chrome/browser/ui/search/new_tab_page_interceptor_service_factory.h" |
| 51 #include "chrome/common/chrome_paths.h" | 53 #include "chrome/common/chrome_paths.h" |
| 52 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
| 53 #include "chrome/common/pref_names.h" | 55 #include "chrome/common/pref_names.h" |
| 54 #include "chrome/common/url_constants.h" | 56 #include "chrome/common/url_constants.h" |
| 55 #include "components/content_settings/core/browser/content_settings_provider.h" | 57 #include "components/content_settings/core/browser/content_settings_provider.h" |
| 56 #include "components/content_settings/core/browser/host_content_settings_map.h" | 58 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 57 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 59 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
| 58 #include "components/dom_distiller/core/url_constants.h" | 60 #include "components/dom_distiller/core/url_constants.h" |
| 59 #include "components/startup_metric_utils/startup_metric_utils.h" | 61 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 60 #include "components/sync_driver/pref_names.h" | 62 #include "components/sync_driver/pref_names.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 ProtocolHandlerRegistry* protocol_handler_registry = | 393 ProtocolHandlerRegistry* protocol_handler_registry = |
| 392 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); | 394 ProtocolHandlerRegistryFactory::GetForBrowserContext(profile); |
| 393 DCHECK(protocol_handler_registry); | 395 DCHECK(protocol_handler_registry); |
| 394 | 396 |
| 395 // The profile instance is only available here in the InitializeOnUIThread | 397 // The profile instance is only available here in the InitializeOnUIThread |
| 396 // method, so we create the url job factory here, then save it for | 398 // method, so we create the url job factory here, then save it for |
| 397 // later delivery to the job factory in Init(). | 399 // later delivery to the job factory in Init(). |
| 398 params->protocol_handler_interceptor = | 400 params->protocol_handler_interceptor = |
| 399 protocol_handler_registry->CreateJobInterceptorFactory(); | 401 protocol_handler_registry->CreateJobInterceptorFactory(); |
| 400 | 402 |
| 403 NewTabPageInterceptorService* new_tab_interceptor_service = |
| 404 NewTabPageInterceptorServiceFactory::GetForProfile(profile); |
| 405 if (new_tab_interceptor_service) { |
| 406 params->new_tab_page_interceptor = |
| 407 new_tab_interceptor_service->CreateInterceptor(); |
| 408 } |
| 409 |
| 401 params->proxy_config_service | 410 params->proxy_config_service |
| 402 .reset(ProxyServiceFactory::CreateProxyConfigService( | 411 .reset(ProxyServiceFactory::CreateProxyConfigService( |
| 403 profile->GetProxyConfigTracker())); | 412 profile->GetProxyConfigTracker())); |
| 404 #if defined(ENABLE_SUPERVISED_USERS) | 413 #if defined(ENABLE_SUPERVISED_USERS) |
| 405 SupervisedUserService* supervised_user_service = | 414 SupervisedUserService* supervised_user_service = |
| 406 SupervisedUserServiceFactory::GetForProfile(profile); | 415 SupervisedUserServiceFactory::GetForProfile(profile); |
| 407 params->supervised_user_url_filter = | 416 params->supervised_user_url_filter = |
| 408 supervised_user_service->GetURLFilterForIOThread(); | 417 supervised_user_service->GetURLFilterForIOThread(); |
| 409 #endif | 418 #endif |
| 410 #if defined(OS_CHROMEOS) | 419 #if defined(OS_CHROMEOS) |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 main_request_context_->set_cert_verifier(cert_verifier_.get()); | 1131 main_request_context_->set_cert_verifier(cert_verifier_.get()); |
| 1123 #else | 1132 #else |
| 1124 main_request_context_->set_cert_verifier( | 1133 main_request_context_->set_cert_verifier( |
| 1125 io_thread_globals->cert_verifier.get()); | 1134 io_thread_globals->cert_verifier.get()); |
| 1126 #endif | 1135 #endif |
| 1127 | 1136 |
| 1128 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 1137 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
| 1129 tracked_objects::ScopedTracker tracking_profile5( | 1138 tracked_objects::ScopedTracker tracking_profile5( |
| 1130 FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 ProfileIOData::Init5")); | 1139 FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 ProfileIOData::Init5")); |
| 1131 | 1140 |
| 1141 // Install the New Tab Page Interceptor. |
| 1142 if (profile_params_->new_tab_page_interceptor.get()) { |
| 1143 request_interceptors.push_back( |
| 1144 profile_params_->new_tab_page_interceptor.release()); |
| 1145 } |
| 1146 |
| 1132 InitializeInternal( | 1147 InitializeInternal( |
| 1133 network_delegate.Pass(), profile_params_.get(), | 1148 network_delegate.Pass(), profile_params_.get(), |
| 1134 protocol_handlers, request_interceptors.Pass()); | 1149 protocol_handlers, request_interceptors.Pass()); |
| 1135 | 1150 |
| 1136 profile_params_.reset(); | 1151 profile_params_.reset(); |
| 1137 initialized_ = true; | 1152 initialized_ = true; |
| 1138 } | 1153 } |
| 1139 | 1154 |
| 1140 void ProfileIOData::ApplyProfileParamsToContext( | 1155 void ProfileIOData::ApplyProfileParamsToContext( |
| 1141 net::URLRequestContext* context) const { | 1156 net::URLRequestContext* context) const { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 void ProfileIOData::SetCookieSettingsForTesting( | 1346 void ProfileIOData::SetCookieSettingsForTesting( |
| 1332 CookieSettings* cookie_settings) { | 1347 CookieSettings* cookie_settings) { |
| 1333 DCHECK(!cookie_settings_.get()); | 1348 DCHECK(!cookie_settings_.get()); |
| 1334 cookie_settings_ = cookie_settings; | 1349 cookie_settings_ = cookie_settings; |
| 1335 } | 1350 } |
| 1336 | 1351 |
| 1337 void ProfileIOData::set_signin_names_for_testing( | 1352 void ProfileIOData::set_signin_names_for_testing( |
| 1338 SigninNamesOnIOThread* signin_names) { | 1353 SigninNamesOnIOThread* signin_names) { |
| 1339 signin_names_.reset(signin_names); | 1354 signin_names_.reset(signin_names); |
| 1340 } | 1355 } |
| OLD | NEW |