| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 | 903 |
| 904 bool ProfileIOData::IsDataReductionProxyEnabled() const { | 904 bool ProfileIOData::IsDataReductionProxyEnabled() const { |
| 905 return data_reduction_proxy_io_data() && | 905 return data_reduction_proxy_io_data() && |
| 906 data_reduction_proxy_io_data()->IsEnabled(); | 906 data_reduction_proxy_io_data()->IsEnabled(); |
| 907 } | 907 } |
| 908 | 908 |
| 909 chrome_browser_net::Predictor* ProfileIOData::GetPredictor() { | 909 chrome_browser_net::Predictor* ProfileIOData::GetPredictor() { |
| 910 return nullptr; | 910 return nullptr; |
| 911 } | 911 } |
| 912 | 912 |
| 913 std::unique_ptr<net::ClientCertStore> ProfileIOData::CreateClientCertStore() { |
| 914 if (!client_cert_store_factory_.is_null()) |
| 915 return client_cert_store_factory_.Run(); |
| 916 #if defined(OS_CHROMEOS) |
| 917 return std::unique_ptr<net::ClientCertStore>( |
| 918 new chromeos::ClientCertStoreChromeOS( |
| 919 certificate_provider_ ? certificate_provider_->Copy() : nullptr, |
| 920 base::WrapUnique(new chromeos::ClientCertFilterChromeOS( |
| 921 use_system_key_slot_, username_hash_)), |
| 922 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, |
| 923 chrome::kCryptoModulePasswordClientAuth))); |
| 924 #elif defined(USE_NSS_CERTS) |
| 925 return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS( |
| 926 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, |
| 927 chrome::kCryptoModulePasswordClientAuth))); |
| 928 #elif defined(OS_WIN) |
| 929 return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin()); |
| 930 #elif defined(OS_MACOSX) |
| 931 return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac()); |
| 932 #elif defined(OS_ANDROID) |
| 933 // Android does not use the ClientCertStore infrastructure. On Android client |
| 934 // cert matching is done by the OS as part of the call to show the cert |
| 935 // selection dialog. |
| 936 return nullptr; |
| 937 #else |
| 938 #error Unknown platform. |
| 939 #endif |
| 940 } |
| 941 |
| 913 void ProfileIOData::set_data_reduction_proxy_io_data( | 942 void ProfileIOData::set_data_reduction_proxy_io_data( |
| 914 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> | 943 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> |
| 915 data_reduction_proxy_io_data) const { | 944 data_reduction_proxy_io_data) const { |
| 916 data_reduction_proxy_io_data_ = std::move(data_reduction_proxy_io_data); | 945 data_reduction_proxy_io_data_ = std::move(data_reduction_proxy_io_data); |
| 917 } | 946 } |
| 918 | 947 |
| 919 net::HttpServerProperties* ProfileIOData::http_server_properties() const { | 948 net::HttpServerProperties* ProfileIOData::http_server_properties() const { |
| 920 return http_server_properties_.get(); | 949 return http_server_properties_.get(); |
| 921 } | 950 } |
| 922 | 951 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 939 DCHECK(io_data_->initialized_); | 968 DCHECK(io_data_->initialized_); |
| 940 return host_resolver_; | 969 return host_resolver_; |
| 941 } | 970 } |
| 942 | 971 |
| 943 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { | 972 net::URLRequestContext* ProfileIOData::ResourceContext::GetRequestContext() { |
| 944 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 973 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 945 DCHECK(io_data_->initialized_); | 974 DCHECK(io_data_->initialized_); |
| 946 return request_context_; | 975 return request_context_; |
| 947 } | 976 } |
| 948 | 977 |
| 949 std::unique_ptr<net::ClientCertStore> | |
| 950 ProfileIOData::ResourceContext::CreateClientCertStore() { | |
| 951 if (!io_data_->client_cert_store_factory_.is_null()) | |
| 952 return io_data_->client_cert_store_factory_.Run(); | |
| 953 #if defined(OS_CHROMEOS) | |
| 954 return std::unique_ptr<net::ClientCertStore>( | |
| 955 new chromeos::ClientCertStoreChromeOS( | |
| 956 io_data_->certificate_provider_ | |
| 957 ? io_data_->certificate_provider_->Copy() | |
| 958 : nullptr, | |
| 959 base::WrapUnique(new chromeos::ClientCertFilterChromeOS( | |
| 960 io_data_->use_system_key_slot(), io_data_->username_hash())), | |
| 961 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, | |
| 962 chrome::kCryptoModulePasswordClientAuth))); | |
| 963 #elif defined(USE_NSS_CERTS) | |
| 964 return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreNSS( | |
| 965 base::Bind(&CreateCryptoModuleBlockingPasswordDelegate, | |
| 966 chrome::kCryptoModulePasswordClientAuth))); | |
| 967 #elif defined(OS_WIN) | |
| 968 return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreWin()); | |
| 969 #elif defined(OS_MACOSX) | |
| 970 return std::unique_ptr<net::ClientCertStore>(new net::ClientCertStoreMac()); | |
| 971 #elif defined(OS_ANDROID) | |
| 972 // Android does not use the ClientCertStore infrastructure. On Android client | |
| 973 // cert matching is done by the OS as part of the call to show the cert | |
| 974 // selection dialog. | |
| 975 return nullptr; | |
| 976 #else | |
| 977 #error Unknown platform. | |
| 978 #endif | |
| 979 } | |
| 980 | |
| 981 void ProfileIOData::ResourceContext::CreateKeygenHandler( | 978 void ProfileIOData::ResourceContext::CreateKeygenHandler( |
| 982 uint32_t key_size_in_bits, | 979 uint32_t key_size_in_bits, |
| 983 const std::string& challenge_string, | 980 const std::string& challenge_string, |
| 984 const GURL& url, | 981 const GURL& url, |
| 985 const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { | 982 const base::Callback<void(std::unique_ptr<net::KeygenHandler>)>& callback) { |
| 986 DCHECK(!callback.is_null()); | 983 DCHECK(!callback.is_null()); |
| 987 #if defined(USE_NSS_CERTS) | 984 #if defined(USE_NSS_CERTS) |
| 988 std::unique_ptr<net::KeygenHandler> keygen_handler( | 985 std::unique_ptr<net::KeygenHandler> keygen_handler( |
| 989 new net::KeygenHandler(key_size_in_bits, challenge_string, url)); | 986 new net::KeygenHandler(key_size_in_bits, challenge_string, url)); |
| 990 | 987 |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 void ProfileIOData::SetCookieSettingsForTesting( | 1355 void ProfileIOData::SetCookieSettingsForTesting( |
| 1359 content_settings::CookieSettings* cookie_settings) { | 1356 content_settings::CookieSettings* cookie_settings) { |
| 1360 DCHECK(!cookie_settings_.get()); | 1357 DCHECK(!cookie_settings_.get()); |
| 1361 cookie_settings_ = cookie_settings; | 1358 cookie_settings_ = cookie_settings; |
| 1362 } | 1359 } |
| 1363 | 1360 |
| 1364 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( | 1361 policy::URLBlacklist::URLBlacklistState ProfileIOData::GetURLBlacklistState( |
| 1365 const GURL& url) const { | 1362 const GURL& url) const { |
| 1366 return url_blacklist_manager_->GetURLBlacklistState(url); | 1363 return url_blacklist_manager_->GetURLBlacklistState(url); |
| 1367 } | 1364 } |
| OLD | NEW |