| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chromeos/cert_loader.h" | 5 #include "chromeos/cert_loader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // and CryptohomeClient calls are not thread safe. | 205 // and CryptohomeClient calls are not thread safe. |
| 206 DBusThreadManager::Get()->GetCryptohomeClient()->Pkcs11GetTpmTokenInfo( | 206 DBusThreadManager::Get()->GetCryptohomeClient()->Pkcs11GetTpmTokenInfo( |
| 207 base::Bind(&CertLoader::OnPkcs11GetTpmTokenInfo, | 207 base::Bind(&CertLoader::OnPkcs11GetTpmTokenInfo, |
| 208 initialize_token_factory_.GetWeakPtr())); | 208 initialize_token_factory_.GetWeakPtr())); |
| 209 return; | 209 return; |
| 210 } | 210 } |
| 211 case TPM_TOKEN_INFO_RECEIVED: { | 211 case TPM_TOKEN_INFO_RECEIVED: { |
| 212 base::PostTaskAndReplyWithResult( | 212 base::PostTaskAndReplyWithResult( |
| 213 crypto_task_runner_.get(), | 213 crypto_task_runner_.get(), |
| 214 FROM_HERE, | 214 FROM_HERE, |
| 215 base::Bind(&crypto::InitializeTPMToken, | 215 base::Bind(&crypto::InitializeTPMToken, tpm_token_slot_id_), |
| 216 tpm_token_name_, | |
| 217 tpm_token_slot_id_, | |
| 218 tpm_user_pin_), | |
| 219 base::Bind(&CertLoader::OnTPMTokenInitialized, | 216 base::Bind(&CertLoader::OnTPMTokenInitialized, |
| 220 initialize_token_factory_.GetWeakPtr())); | 217 initialize_token_factory_.GetWeakPtr())); |
| 221 return; | 218 return; |
| 222 } | 219 } |
| 223 case TPM_TOKEN_INITIALIZED: { | 220 case TPM_TOKEN_INITIALIZED: { |
| 224 StartLoadCertificates(); | 221 StartLoadCertificates(); |
| 225 return; | 222 return; |
| 226 } | 223 } |
| 227 } | 224 } |
| 228 } | 225 } |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 VLOG(1) << "OnCertRemoved"; | 392 VLOG(1) << "OnCertRemoved"; |
| 396 LoadCertificates(); | 393 LoadCertificates(); |
| 397 } | 394 } |
| 398 | 395 |
| 399 void CertLoader::LoggedInStateChanged() { | 396 void CertLoader::LoggedInStateChanged() { |
| 400 VLOG(1) << "LoggedInStateChanged"; | 397 VLOG(1) << "LoggedInStateChanged"; |
| 401 MaybeRequestCertificates(); | 398 MaybeRequestCertificates(); |
| 402 } | 399 } |
| 403 | 400 |
| 404 } // namespace chromeos | 401 } // namespace chromeos |
| OLD | NEW |