| OLD | NEW |
| 1 // Copyright (c) 2011 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/certificate_manager_model.h" | 5 #include "chrome/browser/certificate_manager_model.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/ui/crypto_module_password_dialog.h" | 11 #include "chrome/browser/ui/crypto_module_password_dialog.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 net::CertDatabase::TrustBits trust_bits, | 126 net::CertDatabase::TrustBits trust_bits, |
| 127 net::CertDatabase::ImportCertFailureList* not_imported) { | 127 net::CertDatabase::ImportCertFailureList* not_imported) { |
| 128 bool result = cert_db_.ImportCACerts(certificates, trust_bits, not_imported); | 128 bool result = cert_db_.ImportCACerts(certificates, trust_bits, not_imported); |
| 129 if (result && not_imported->size() != certificates.size()) | 129 if (result && not_imported->size() != certificates.size()) |
| 130 Refresh(); | 130 Refresh(); |
| 131 return result; | 131 return result; |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool CertificateManagerModel::ImportServerCert( | 134 bool CertificateManagerModel::ImportServerCert( |
| 135 const net::CertificateList& certificates, | 135 const net::CertificateList& certificates, |
| 136 net::CertDatabase::TrustBits trust_bits, |
| 136 net::CertDatabase::ImportCertFailureList* not_imported) { | 137 net::CertDatabase::ImportCertFailureList* not_imported) { |
| 137 bool result = cert_db_.ImportServerCert(certificates, not_imported); | 138 bool result = cert_db_.ImportServerCert(certificates, trust_bits, |
| 139 not_imported); |
| 138 if (result && not_imported->size() != certificates.size()) | 140 if (result && not_imported->size() != certificates.size()) |
| 139 Refresh(); | 141 Refresh(); |
| 140 return result; | 142 return result; |
| 141 } | 143 } |
| 142 | 144 |
| 143 bool CertificateManagerModel::SetCertTrust( | 145 bool CertificateManagerModel::SetCertTrust( |
| 144 const net::X509Certificate* cert, | 146 const net::X509Certificate* cert, |
| 145 net::CertType type, | 147 net::CertType type, |
| 146 net::CertDatabase::TrustBits trust_bits) { | 148 net::CertDatabase::TrustBits trust_bits) { |
| 147 return cert_db_.SetCertTrust(cert, type, trust_bits); | 149 return cert_db_.SetCertTrust(cert, type, trust_bits); |
| 148 } | 150 } |
| 149 | 151 |
| 150 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { | 152 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { |
| 151 bool result = cert_db_.DeleteCertAndKey(cert); | 153 bool result = cert_db_.DeleteCertAndKey(cert); |
| 152 if (result) | 154 if (result) |
| 153 Refresh(); | 155 Refresh(); |
| 154 return result; | 156 return result; |
| 155 } | 157 } |
| OLD | NEW |