| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 #if defined(OS_ANDROID) | 102 #if defined(OS_ANDROID) |
| 103 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 103 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
| 104 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" | 104 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact
ory.h" |
| 105 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" | 105 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" |
| 106 #endif // defined(OS_ANDROID) | 106 #endif // defined(OS_ANDROID) |
| 107 | 107 |
| 108 #if defined(OS_CHROMEOS) | 108 #if defined(OS_CHROMEOS) |
| 109 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" | 109 #include "chrome/browser/chromeos/drive/drive_protocol_handler.h" |
| 110 #include "chrome/browser/chromeos/login/startup_utils.h" | 110 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 111 #include "chrome/browser/chromeos/login/users/user_manager.h" | |
| 112 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" | 111 #include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" |
| 113 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 112 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 114 #include "chrome/browser/chromeos/policy/policy_cert_service.h" | 113 #include "chrome/browser/chromeos/policy/policy_cert_service.h" |
| 115 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" | 114 #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h" |
| 116 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" | 115 #include "chrome/browser/chromeos/policy/policy_cert_verifier.h" |
| 117 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 116 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 118 #include "chrome/browser/chromeos/settings/cros_settings.h" | 117 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 119 #include "chrome/browser/net/nss_context.h" | 118 #include "chrome/browser/net/nss_context.h" |
| 120 #include "chromeos/dbus/cryptohome_client.h" | 119 #include "chromeos/dbus/cryptohome_client.h" |
| 121 #include "chromeos/dbus/dbus_thread_manager.h" | 120 #include "chromeos/dbus/dbus_thread_manager.h" |
| 122 #include "chromeos/settings/cros_settings_names.h" | 121 #include "chromeos/settings/cros_settings_names.h" |
| 123 #include "components/user_manager/user.h" | 122 #include "components/user_manager/user.h" |
| 123 #include "components/user_manager/user_manager.h" |
| 124 #include "crypto/nss_util.h" | 124 #include "crypto/nss_util.h" |
| 125 #include "crypto/nss_util_internal.h" | 125 #include "crypto/nss_util_internal.h" |
| 126 #include "net/cert/multi_threaded_cert_verifier.h" | 126 #include "net/cert/multi_threaded_cert_verifier.h" |
| 127 #include "net/ssl/client_cert_store_chromeos.h" | 127 #include "net/ssl/client_cert_store_chromeos.h" |
| 128 #endif // defined(OS_CHROMEOS) | 128 #endif // defined(OS_CHROMEOS) |
| 129 | 129 |
| 130 #if defined(USE_NSS) | 130 #if defined(USE_NSS) |
| 131 #include "chrome/browser/ui/crypto_module_delegate_nss.h" | 131 #include "chrome/browser/ui/crypto_module_delegate_nss.h" |
| 132 #include "net/ssl/client_cert_store_nss.h" | 132 #include "net/ssl/client_cert_store_nss.h" |
| 133 #endif | 133 #endif |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 }; | 217 }; |
| 218 #endif // defined(DEBUG_DEVTOOLS) | 218 #endif // defined(DEBUG_DEVTOOLS) |
| 219 | 219 |
| 220 #if defined(OS_CHROMEOS) | 220 #if defined(OS_CHROMEOS) |
| 221 // The following four functions are responsible for initializing NSS for each | 221 // The following four functions are responsible for initializing NSS for each |
| 222 // profile on ChromeOS, which has a separate NSS database and TPM slot | 222 // profile on ChromeOS, which has a separate NSS database and TPM slot |
| 223 // per-profile. | 223 // per-profile. |
| 224 // | 224 // |
| 225 // Initialization basically follows these steps: | 225 // Initialization basically follows these steps: |
| 226 // 1) Get some info from chromeos::UserManager about the User for this profile. | 226 // 1) Get some info from user_manager::UserManager about the User for this |
| 227 // profile. |
| 227 // 2) Tell nss_util to initialize the software slot for this profile. | 228 // 2) Tell nss_util to initialize the software slot for this profile. |
| 228 // 3) Wait for the TPM module to be loaded by nss_util if it isn't already. | 229 // 3) Wait for the TPM module to be loaded by nss_util if it isn't already. |
| 229 // 4) Ask CryptohomeClient which TPM slot id corresponds to this profile. | 230 // 4) Ask CryptohomeClient which TPM slot id corresponds to this profile. |
| 230 // 5) Tell nss_util to use that slot id on the TPM module. | 231 // 5) Tell nss_util to use that slot id on the TPM module. |
| 231 // | 232 // |
| 232 // Some of these steps must happen on the UI thread, others must happen on the | 233 // Some of these steps must happen on the UI thread, others must happen on the |
| 233 // IO thread: | 234 // IO thread: |
| 234 // UI thread IO Thread | 235 // UI thread IO Thread |
| 235 // | 236 // |
| 236 // ProfileIOData::InitializeOnUIThread | 237 // ProfileIOData::InitializeOnUIThread |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 params->proxy_config_service | 360 params->proxy_config_service |
| 360 .reset(ProxyServiceFactory::CreateProxyConfigService( | 361 .reset(ProxyServiceFactory::CreateProxyConfigService( |
| 361 profile->GetProxyConfigTracker())); | 362 profile->GetProxyConfigTracker())); |
| 362 #if defined(ENABLE_MANAGED_USERS) | 363 #if defined(ENABLE_MANAGED_USERS) |
| 363 SupervisedUserService* supervised_user_service = | 364 SupervisedUserService* supervised_user_service = |
| 364 SupervisedUserServiceFactory::GetForProfile(profile); | 365 SupervisedUserServiceFactory::GetForProfile(profile); |
| 365 params->supervised_user_url_filter = | 366 params->supervised_user_url_filter = |
| 366 supervised_user_service->GetURLFilterForIOThread(); | 367 supervised_user_service->GetURLFilterForIOThread(); |
| 367 #endif | 368 #endif |
| 368 #if defined(OS_CHROMEOS) | 369 #if defined(OS_CHROMEOS) |
| 369 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 370 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 370 if (user_manager) { | 371 if (user_manager) { |
| 371 user_manager::User* user = | 372 user_manager::User* user = |
| 372 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 373 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 373 // No need to initialize NSS for users with empty username hash: | 374 // No need to initialize NSS for users with empty username hash: |
| 374 // Getters for a user's NSS slots always return NULL slot if the user's | 375 // Getters for a user's NSS slots always return NULL slot if the user's |
| 375 // username hash is empty, even when the NSS is not initialized for the | 376 // username hash is empty, even when the NSS is not initialized for the |
| 376 // user. | 377 // user. |
| 377 if (user && !user->username_hash().empty()) { | 378 if (user && !user->username_hash().empty()) { |
| 378 params->username_hash = user->username_hash(); | 379 params->username_hash = user->username_hash(); |
| 379 DCHECK(!params->username_hash.empty()); | 380 DCHECK(!params->username_hash.empty()); |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 void ProfileIOData::SetCookieSettingsForTesting( | 1275 void ProfileIOData::SetCookieSettingsForTesting( |
| 1275 CookieSettings* cookie_settings) { | 1276 CookieSettings* cookie_settings) { |
| 1276 DCHECK(!cookie_settings_.get()); | 1277 DCHECK(!cookie_settings_.get()); |
| 1277 cookie_settings_ = cookie_settings; | 1278 cookie_settings_ = cookie_settings; |
| 1278 } | 1279 } |
| 1279 | 1280 |
| 1280 void ProfileIOData::set_signin_names_for_testing( | 1281 void ProfileIOData::set_signin_names_for_testing( |
| 1281 SigninNamesOnIOThread* signin_names) { | 1282 SigninNamesOnIOThread* signin_names) { |
| 1282 signin_names_.reset(signin_names); | 1283 signin_names_.reset(signin_names); |
| 1283 } | 1284 } |
| OLD | NEW |