Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/certificate_manager_model.cc

Issue 4310004: DOMUI Cert Manager: merge email certs into other certs tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/common/net/x509_certificate_model.h" 10 #include "chrome/common/net/x509_certificate_model.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 rv = ASCIIToUTF16( 63 rv = ASCIIToUTF16(
64 x509_certificate_model::GetSerialNumberHexified( 64 x509_certificate_model::GetSerialNumberHexified(
65 cert.os_cert_handle(), "")); 65 cert.os_cert_handle(), ""));
66 break; 66 break;
67 case COL_EXPIRES_ON: 67 case COL_EXPIRES_ON:
68 if (!cert.valid_expiry().is_null()) { 68 if (!cert.valid_expiry().is_null()) {
69 rv = WideToUTF16Hack( 69 rv = WideToUTF16Hack(
70 base::TimeFormatShortDateNumeric(cert.valid_expiry())); 70 base::TimeFormatShortDateNumeric(cert.valid_expiry()));
71 } 71 }
72 break; 72 break;
73 case COL_EMAIL_ADDRESS:
74 rv = UTF8ToUTF16(
75 x509_certificate_model::GetEmailAddress(cert.os_cert_handle()));
76 break;
77 default: 73 default:
78 NOTREACHED(); 74 NOTREACHED();
79 } 75 }
80 return rv; 76 return rv;
81 } 77 }
82 78
83 int CertificateManagerModel::ImportFromPKCS12(const std::string& data, 79 int CertificateManagerModel::ImportFromPKCS12(const std::string& data,
84 const string16& password) { 80 const string16& password) {
85 int result = cert_db_.ImportFromPKCS12(data, password); 81 int result = cert_db_.ImportFromPKCS12(data, password);
86 if (result == net::OK) 82 if (result == net::OK)
(...skipping 25 matching lines...) Expand all
112 unsigned int trust_bits) { 108 unsigned int trust_bits) {
113 return cert_db_.SetCertTrust(cert, type, trust_bits); 109 return cert_db_.SetCertTrust(cert, type, trust_bits);
114 } 110 }
115 111
116 bool CertificateManagerModel::Delete(net::X509Certificate* cert) { 112 bool CertificateManagerModel::Delete(net::X509Certificate* cert) {
117 bool result = cert_db_.DeleteCertAndKey(cert); 113 bool result = cert_db_.DeleteCertAndKey(cert);
118 if (result) 114 if (result)
119 Refresh(); 115 Refresh();
120 return result; 116 return result;
121 } 117 }
OLDNEW
« no previous file with comments | « chrome/browser/certificate_manager_model.h ('k') | chrome/browser/dom_ui/options/certificate_manager_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698