| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/chromeos/options/cert_library.h" | 5 #include "chrome/browser/chromeos/options/cert_library.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/string_compare.h" | 10 #include "base/i18n/string_compare.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool CertLibrary::CertificatesLoaded() const { | 144 bool CertLibrary::CertificatesLoaded() const { |
| 145 return CertLoader::Get()->certificates_loaded(); | 145 return CertLoader::Get()->certificates_loaded(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool CertLibrary::IsHardwareBacked() const { | 148 bool CertLibrary::IsHardwareBacked() const { |
| 149 return CertLoader::Get()->IsHardwareBacked(); | 149 return CertLoader::Get()->IsHardwareBacked(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 std::string CertLibrary::GetTPMSlotID() const { |
| 153 return base::IntToString(CertLoader::Get()->TPMTokenSlotID()); |
| 154 } |
| 155 |
| 152 int CertLibrary::NumCertificates(CertType type) const { | 156 int CertLibrary::NumCertificates(CertType type) const { |
| 153 const net::CertificateList& cert_list = GetCertificateListForType(type); | 157 const net::CertificateList& cert_list = GetCertificateListForType(type); |
| 154 return static_cast<int>(cert_list.size()); | 158 return static_cast<int>(cert_list.size()); |
| 155 } | 159 } |
| 156 | 160 |
| 157 base::string16 CertLibrary::GetCertDisplayStringAt(CertType type, | 161 base::string16 CertLibrary::GetCertDisplayStringAt(CertType type, |
| 158 int index) const { | 162 int index) const { |
| 159 net::X509Certificate* cert = GetCertificateAt(type, index); | 163 net::X509Certificate* cert = GetCertificateAt(type, index); |
| 160 bool hardware_backed = IsCertHardwareBackedAt(type, index); | 164 bool hardware_backed = IsCertHardwareBackedAt(type, index); |
| 161 return GetDisplayString(cert, hardware_backed); | 165 return GetDisplayString(cert, hardware_backed); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 return user_certs_; | 275 return user_certs_; |
| 272 if (type == CERT_TYPE_SERVER) | 276 if (type == CERT_TYPE_SERVER) |
| 273 return server_certs_; | 277 return server_certs_; |
| 274 if (type == CERT_TYPE_SERVER_CA) | 278 if (type == CERT_TYPE_SERVER_CA) |
| 275 return server_ca_certs_; | 279 return server_ca_certs_; |
| 276 DCHECK(type == CERT_TYPE_DEFAULT); | 280 DCHECK(type == CERT_TYPE_DEFAULT); |
| 277 return certs_; | 281 return certs_; |
| 278 } | 282 } |
| 279 | 283 |
| 280 } // namespace chromeos | 284 } // namespace chromeos |
| OLD | NEW |