| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 #if defined(ENABLE_MANAGED_USERS) | 87 #if defined(ENABLE_MANAGED_USERS) |
| 88 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" | 88 #include "chrome/browser/managed_mode/managed_mode_url_filter.h" |
| 89 #include "chrome/browser/managed_mode/managed_user_service.h" | 89 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 90 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 90 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
| 91 #endif | 91 #endif |
| 92 | 92 |
| 93 #if defined(OS_CHROMEOS) | 93 #if defined(OS_CHROMEOS) |
| 94 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" | 94 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" |
| 95 #include "chrome/browser/chromeos/login/user.h" | 95 #include "chrome/browser/chromeos/login/user.h" |
| 96 #include "chrome/browser/chromeos/login/user_manager.h" | 96 #include "chrome/browser/chromeos/login/user_manager.h" |
| 97 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
| 97 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 98 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
| 98 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 99 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
| 99 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 100 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
| 100 #include "chrome/browser/chromeos/settings/cros_settings.h" | 101 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 101 #include "chromeos/dbus/cryptohome_client.h" | 102 #include "chromeos/dbus/cryptohome_client.h" |
| 102 #include "chromeos/dbus/dbus_thread_manager.h" | 103 #include "chromeos/dbus/dbus_thread_manager.h" |
| 103 #include "chromeos/settings/cros_settings_names.h" | 104 #include "chromeos/settings/cros_settings_names.h" |
| 104 #include "crypto/nss_util.h" | 105 #include "crypto/nss_util.h" |
| 105 #include "crypto/nss_util_internal.h" | 106 #include "crypto/nss_util_internal.h" |
| 107 #include "net/cert/multi_threaded_cert_verifier.h" |
| 106 #include "net/ssl/client_cert_store_chromeos.h" | 108 #include "net/ssl/client_cert_store_chromeos.h" |
| 107 #endif // defined(OS_CHROMEOS) | 109 #endif // defined(OS_CHROMEOS) |
| 108 | 110 |
| 109 #if defined(USE_NSS) | 111 #if defined(USE_NSS) |
| 110 #include "chrome/browser/ui/crypto_module_delegate_nss.h" | 112 #include "chrome/browser/ui/crypto_module_delegate_nss.h" |
| 111 #include "net/ssl/client_cert_store_nss.h" | 113 #include "net/ssl/client_cert_store_nss.h" |
| 112 #endif | 114 #endif |
| 113 | 115 |
| 114 #if defined(OS_WIN) | 116 #if defined(OS_WIN) |
| 115 #include "net/ssl/client_cert_store_win.h" | 117 #include "net/ssl/client_cert_store_win.h" |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 extension_info_map_ = profile_params_->extension_info_map; | 962 extension_info_map_ = profile_params_->extension_info_map; |
| 961 | 963 |
| 962 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); | 964 resource_context_->host_resolver_ = io_thread_globals->host_resolver.get(); |
| 963 resource_context_->request_context_ = main_request_context_.get(); | 965 resource_context_->request_context_ = main_request_context_.get(); |
| 964 | 966 |
| 965 #if defined(ENABLE_MANAGED_USERS) | 967 #if defined(ENABLE_MANAGED_USERS) |
| 966 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; | 968 managed_mode_url_filter_ = profile_params_->managed_mode_url_filter; |
| 967 #endif | 969 #endif |
| 968 | 970 |
| 969 #if defined(OS_CHROMEOS) | 971 #if defined(OS_CHROMEOS) |
| 972 username_hash_ = profile_params_->username_hash; |
| 973 crypto::ScopedPK11Slot public_slot = |
| 974 crypto::GetPublicSlotForChromeOSUser(username_hash_); |
| 975 // Private slot won't be ready by this point, just pass NULL. It shouldn't be |
| 976 // necessary for cert trust purposes anyway. |
| 977 scoped_refptr<net::CertVerifyProc> verify_proc = |
| 978 new chromeos::CertVerifyProcChromeOS(public_slot.Pass()); |
| 970 if (cert_verifier_) { | 979 if (cert_verifier_) { |
| 971 cert_verifier_->InitializeOnIOThread(); | 980 cert_verifier_->InitializeOnIOThread(verify_proc.get()); |
| 972 main_request_context_->set_cert_verifier(cert_verifier_.get()); | 981 main_request_context_->set_cert_verifier(cert_verifier_.get()); |
| 973 } else { | 982 } else { |
| 974 main_request_context_->set_cert_verifier( | 983 main_request_context_->set_cert_verifier( |
| 975 io_thread_globals->cert_verifier.get()); | 984 new net::MultiThreadedCertVerifier(verify_proc.get())); |
| 976 } | 985 } |
| 977 username_hash_ = profile_params_->username_hash; | |
| 978 #else | 986 #else |
| 979 main_request_context_->set_cert_verifier( | 987 main_request_context_->set_cert_verifier( |
| 980 io_thread_globals->cert_verifier.get()); | 988 io_thread_globals->cert_verifier.get()); |
| 981 #endif | 989 #endif |
| 982 | 990 |
| 983 InitializeInternal(profile_params_.get(), protocol_handlers); | 991 InitializeInternal(profile_params_.get(), protocol_handlers); |
| 984 | 992 |
| 985 profile_params_.reset(); | 993 profile_params_.reset(); |
| 986 initialized_ = true; | 994 initialized_ = true; |
| 987 } | 995 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 void ProfileIOData::SetCookieSettingsForTesting( | 1139 void ProfileIOData::SetCookieSettingsForTesting( |
| 1132 CookieSettings* cookie_settings) { | 1140 CookieSettings* cookie_settings) { |
| 1133 DCHECK(!cookie_settings_.get()); | 1141 DCHECK(!cookie_settings_.get()); |
| 1134 cookie_settings_ = cookie_settings; | 1142 cookie_settings_ = cookie_settings; |
| 1135 } | 1143 } |
| 1136 | 1144 |
| 1137 void ProfileIOData::set_signin_names_for_testing( | 1145 void ProfileIOData::set_signin_names_for_testing( |
| 1138 SigninNamesOnIOThread* signin_names) { | 1146 SigninNamesOnIOThread* signin_names) { |
| 1139 signin_names_.reset(signin_names); | 1147 signin_names_.reset(signin_names); |
| 1140 } | 1148 } |
| OLD | NEW |