| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 NOTREACHED(); | 108 NOTREACHED(); |
| 109 } | 109 } |
| 110 return rv; | 110 return rv; |
| 111 } | 111 } |
| 112 | 112 |
| 113 int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module, | 113 int CertificateManagerModel::ImportFromPKCS12(net::CryptoModule* module, |
| 114 const std::string& data, | 114 const std::string& data, |
| 115 const string16& password, | 115 const string16& password, |
| 116 bool is_extractable) { | 116 bool is_extractable) { |
| 117 int result = cert_db_.ImportFromPKCS12(module, data, password, | 117 int result = cert_db_.ImportFromPKCS12(module, data, password, |
| 118 is_extractable); | 118 is_extractable, NULL); |
| 119 if (result == net::OK) | 119 if (result == net::OK) |
| 120 Refresh(); | 120 Refresh(); |
| 121 return result; | 121 return result; |
| 122 } | 122 } |
| 123 | 123 |
| 124 bool CertificateManagerModel::ImportCACerts( | 124 bool CertificateManagerModel::ImportCACerts( |
| 125 const net::CertificateList& certificates, | 125 const net::CertificateList& certificates, |
| 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); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 146 net::CertDatabase::TrustBits trust_bits) { | 146 net::CertDatabase::TrustBits trust_bits) { |
| 147 return cert_db_.SetCertTrust(cert, type, trust_bits); | 147 return cert_db_.SetCertTrust(cert, type, trust_bits); |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { | 150 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { |
| 151 bool result = cert_db_.DeleteCertAndKey(cert); | 151 bool result = cert_db_.DeleteCertAndKey(cert); |
| 152 if (result) | 152 if (result) |
| 153 Refresh(); | 153 Refresh(); |
| 154 return result; | 154 return result; |
| 155 } | 155 } |
| OLD | NEW |