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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 110 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
111 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 111 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
112 #endif | 112 #endif |
113 | 113 |
114 #if defined(OS_ANDROID) | 114 #if defined(OS_ANDROID) |
115 #include "content/public/browser/android/content_protocol_handler.h" | 115 #include "content/public/browser/android/content_protocol_handler.h" |
116 #endif // defined(OS_ANDROID) | 116 #endif // defined(OS_ANDROID) |
117 | 117 |
118 #if defined(OS_CHROMEOS) | 118 #if defined(OS_CHROMEOS) |
119 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" | 119 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" |
| 120 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" |
| 121 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice_factory.h" |
120 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h" | 122 #include "chrome/browser/chromeos/fileapi/external_file_protocol_handler.h" |
121 #include "chrome/browser/chromeos/login/startup_utils.h" | 123 #include "chrome/browser/chromeos/login/startup_utils.h" |
122 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 124 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
123 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" | 125 #include "chrome/browser/chromeos/net/client_cert_filter_chromeos.h" |
124 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h" | 126 #include "chrome/browser/chromeos/net/client_cert_store_chromeos.h" |
125 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 127 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
126 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 128 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
127 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 129 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
128 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 130 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
129 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 131 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 // Use the device-wide system key slot only if the user is of the same | 448 // Use the device-wide system key slot only if the user is of the same |
447 // domain as the device is registered to. | 449 // domain as the device is registered to. |
448 policy::BrowserPolicyConnectorChromeOS* connector = | 450 policy::BrowserPolicyConnectorChromeOS* connector = |
449 g_browser_process->platform_part() | 451 g_browser_process->platform_part() |
450 ->browser_policy_connector_chromeos(); | 452 ->browser_policy_connector_chromeos(); |
451 params->use_system_key_slot = | 453 params->use_system_key_slot = |
452 connector->GetUserAffiliation(user->email()) == | 454 connector->GetUserAffiliation(user->email()) == |
453 policy::USER_AFFILIATION_MANAGED; | 455 policy::USER_AFFILIATION_MANAGED; |
454 } | 456 } |
455 } | 457 } |
| 458 |
| 459 chromeos::CertificateProviderService* cert_provider_service = |
| 460 chromeos::CertificateProviderServiceFactory::GetForBrowserContext( |
| 461 profile); |
| 462 if (cert_provider_service) { |
| 463 params->certificate_provider = |
| 464 cert_provider_service->CreateCertificateProvider(); |
| 465 } |
456 #endif | 466 #endif |
457 | 467 |
458 params->profile = profile; | 468 params->profile = profile; |
459 profile_params_.reset(params.release()); | 469 profile_params_.reset(params.release()); |
460 | 470 |
461 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 471 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
462 &enable_referrers_, | 472 &enable_referrers_, |
463 &enable_do_not_track_, | 473 &enable_do_not_track_, |
464 &force_google_safesearch_, | 474 &force_google_safesearch_, |
465 &force_youtube_safety_mode_, | 475 &force_youtube_safety_mode_, |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 DCHECK(io_data_->initialized_); | 943 DCHECK(io_data_->initialized_); |
934 return request_context_; | 944 return request_context_; |
935 } | 945 } |
936 | 946 |
937 scoped_ptr<net::ClientCertStore> | 947 scoped_ptr<net::ClientCertStore> |
938 ProfileIOData::ResourceContext::CreateClientCertStore() { | 948 ProfileIOData::ResourceContext::CreateClientCertStore() { |
939 if (!io_data_->client_cert_store_factory_.is_null()) | 949 if (!io_data_->client_cert_store_factory_.is_null()) |
940 return io_data_->client_cert_store_factory_.Run(); | 950 return io_data_->client_cert_store_factory_.Run(); |
941 #if defined(OS_CHROMEOS) | 951 #if defined(OS_CHROMEOS) |
942 return scoped_ptr<net::ClientCertStore>(new chromeos::ClientCertStoreChromeOS( | 952 return scoped_ptr<net::ClientCertStore>(new chromeos::ClientCertStoreChromeOS( |
943 nullptr, // no additional provider | 953 io_data_->certificate_provider_->Copy(), |
944 make_scoped_ptr(new chromeos::ClientCertFilterChromeOS( | 954 make_scoped_ptr(new chromeos::ClientCertFilterChromeOS( |
945 io_data_->use_system_key_slot(), io_data_->username_hash())), | 955 io_data_->use_system_key_slot(), io_data_->username_hash())), |
946 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, | 956 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, |
947 chrome::kCryptoModulePasswordClientAuth))); | 957 chrome::kCryptoModulePasswordClientAuth))); |
948 #elif defined(USE_NSS_CERTS) | 958 #elif defined(USE_NSS_CERTS) |
949 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS( | 959 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS( |
950 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, | 960 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, |
951 chrome::kCryptoModulePasswordClientAuth))); | 961 chrome::kCryptoModulePasswordClientAuth))); |
952 #elif defined(OS_WIN) | 962 #elif defined(OS_WIN) |
953 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreWin()); | 963 return scoped_ptr<net::ClientCertStore>(new net::ClientCertStoreWin()); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 | 1109 |
1100 #if defined(ENABLE_SUPERVISED_USERS) | 1110 #if defined(ENABLE_SUPERVISED_USERS) |
1101 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; | 1111 supervised_user_url_filter_ = profile_params_->supervised_user_url_filter; |
1102 #endif | 1112 #endif |
1103 | 1113 |
1104 #if defined(OS_CHROMEOS) | 1114 #if defined(OS_CHROMEOS) |
1105 username_hash_ = profile_params_->username_hash; | 1115 username_hash_ = profile_params_->username_hash; |
1106 use_system_key_slot_ = profile_params_->use_system_key_slot; | 1116 use_system_key_slot_ = profile_params_->use_system_key_slot; |
1107 if (use_system_key_slot_) | 1117 if (use_system_key_slot_) |
1108 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); | 1118 EnableNSSSystemKeySlotForResourceContext(resource_context_.get()); |
| 1119 |
| 1120 certificate_provider_ = profile_params_->certificate_provider.Pass(); |
1109 #endif | 1121 #endif |
1110 | 1122 |
1111 if (g_cert_verifier_for_testing) { | 1123 if (g_cert_verifier_for_testing) { |
1112 main_request_context_->set_cert_verifier(g_cert_verifier_for_testing); | 1124 main_request_context_->set_cert_verifier(g_cert_verifier_for_testing); |
1113 } else { | 1125 } else { |
1114 #if defined(OS_CHROMEOS) | 1126 #if defined(OS_CHROMEOS) |
1115 crypto::ScopedPK11Slot public_slot = | 1127 crypto::ScopedPK11Slot public_slot = |
1116 crypto::GetPublicSlotForChromeOSUser(username_hash_); | 1128 crypto::GetPublicSlotForChromeOSUser(username_hash_); |
1117 // The private slot won't be ready by this point. It shouldn't be necessary | 1129 // The private slot won't be ready by this point. It shouldn't be necessary |
1118 // for cert trust purposes anyway. | 1130 // for cert trust purposes anyway. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 new DevToolsNetworkTransactionFactory( | 1333 new DevToolsNetworkTransactionFactory( |
1322 network_controller_handle_.GetController(), shared_session), | 1334 network_controller_handle_.GetController(), shared_session), |
1323 shared_session->net_log(), backend)); | 1335 shared_session->net_log(), backend)); |
1324 } | 1336 } |
1325 | 1337 |
1326 void ProfileIOData::SetCookieSettingsForTesting( | 1338 void ProfileIOData::SetCookieSettingsForTesting( |
1327 content_settings::CookieSettings* cookie_settings) { | 1339 content_settings::CookieSettings* cookie_settings) { |
1328 DCHECK(!cookie_settings_.get()); | 1340 DCHECK(!cookie_settings_.get()); |
1329 cookie_settings_ = cookie_settings; | 1341 cookie_settings_ = cookie_settings; |
1330 } | 1342 } |
OLD | NEW |