| OLD | NEW |
| 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/ssl_client_certificate_selector.h" | 5 #include "chrome/browser/ssl_client_certificate_selector.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 return rv; | 239 return rv; |
| 240 } | 240 } |
| 241 | 241 |
| 242 // static | 242 // static |
| 243 std::string SSLClientCertificateSelector::FormatDetailsText( | 243 std::string SSLClientCertificateSelector::FormatDetailsText( |
| 244 net::X509Certificate::OSCertHandle cert) { | 244 net::X509Certificate::OSCertHandle cert) { |
| 245 std::string rv; | 245 std::string rv; |
| 246 | 246 |
| 247 rv += l10n_util::GetStringFUTF8( | 247 rv += l10n_util::GetStringFUTF8( |
| 248 IDS_CERT_SUBJECTNAME_FORMAT, | 248 IDS_CERT_SUBJECTNAME_FORMAT, |
| 249 UTF8ToUTF16(x509_certificate_model::GetSubjectName(cert)));; | 249 UTF8ToUTF16(x509_certificate_model::GetSubjectName(cert))); |
| 250 | 250 |
| 251 rv += "\n "; | 251 rv += "\n "; |
| 252 rv += l10n_util::GetStringFUTF8( | 252 rv += l10n_util::GetStringFUTF8( |
| 253 IDS_CERT_SERIAL_NUMBER_FORMAT, | 253 IDS_CERT_SERIAL_NUMBER_FORMAT, |
| 254 UTF8ToUTF16( | 254 UTF8ToUTF16( |
| 255 x509_certificate_model::GetSerialNumberHexified(cert, ""))); | 255 x509_certificate_model::GetSerialNumberHexified(cert, ""))); |
| 256 | 256 |
| 257 base::Time issued, expires; | 257 base::Time issued, expires; |
| 258 if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { | 258 if (x509_certificate_model::GetTimes(cert, &issued, &expires)) { |
| 259 string16 issued_str = WideToUTF16( | 259 string16 issued_str = base::TimeFormatShortDateAndTime(issued); |
| 260 base::TimeFormatShortDateAndTime(issued)); | 260 string16 expires_str = base::TimeFormatShortDateAndTime(expires); |
| 261 string16 expires_str = WideToUTF16( | |
| 262 base::TimeFormatShortDateAndTime(expires)); | |
| 263 rv += "\n "; | 261 rv += "\n "; |
| 264 rv += l10n_util::GetStringFUTF8(IDS_CERT_VALIDITY_RANGE_FORMAT, | 262 rv += l10n_util::GetStringFUTF8(IDS_CERT_VALIDITY_RANGE_FORMAT, |
| 265 issued_str, expires_str); | 263 issued_str, expires_str); |
| 266 } | 264 } |
| 267 | 265 |
| 268 std::vector<std::string> usages; | 266 std::vector<std::string> usages; |
| 269 x509_certificate_model::GetUsageStrings(cert, &usages); | 267 x509_certificate_model::GetUsageStrings(cert, &usages); |
| 270 if (usages.size()) { | 268 if (usages.size()) { |
| 271 rv += "\n "; | 269 rv += "\n "; |
| 272 rv += l10n_util::GetStringFUTF8(IDS_CERT_X509_EXTENDED_KEY_USAGE_FORMAT, | 270 rv += l10n_util::GetStringFUTF8(IDS_CERT_X509_EXTENDED_KEY_USAGE_FORMAT, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 void ShowSSLClientCertificateSelector( | 354 void ShowSSLClientCertificateSelector( |
| 357 TabContents* parent, | 355 TabContents* parent, |
| 358 net::SSLCertRequestInfo* cert_request_info, | 356 net::SSLCertRequestInfo* cert_request_info, |
| 359 SSLClientAuthHandler* delegate) { | 357 SSLClientAuthHandler* delegate) { |
| 360 (new SSLClientCertificateSelector(parent, | 358 (new SSLClientCertificateSelector(parent, |
| 361 cert_request_info, | 359 cert_request_info, |
| 362 delegate))->Show(); | 360 delegate))->Show(); |
| 363 } | 361 } |
| 364 | 362 |
| 365 } // namespace browser | 363 } // namespace browser |
| OLD | NEW |