| 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/gtk/certificate_viewer.h" | 5 #include "chrome/browser/gtk/certificate_viewer.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #include <hasht.h> | 9 #include <hasht.h> |
| 10 #include <sechash.h> | 10 #include <sechash.h> |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 gtk_table_set_col_spacing(table, 0, gtk_util::kLabelSpacing); | 277 gtk_table_set_col_spacing(table, 0, gtk_util::kLabelSpacing); |
| 278 gtk_table_set_row_spacings(table, gtk_util::kControlSpacing); | 278 gtk_table_set_row_spacings(table, gtk_util::kControlSpacing); |
| 279 | 279 |
| 280 gtk_box_pack_start(GTK_BOX(general_page_vbox_), GTK_WIDGET(table), | 280 gtk_box_pack_start(GTK_BOX(general_page_vbox_), GTK_WIDGET(table), |
| 281 FALSE, FALSE, 0); | 281 FALSE, FALSE, 0); |
| 282 int row = 0; | 282 int row = 0; |
| 283 AddTitle(table, row++, | 283 AddTitle(table, row++, |
| 284 l10n_util::GetStringUTF8(IDS_CERT_INFO_SUBJECT_GROUP)); | 284 l10n_util::GetStringUTF8(IDS_CERT_INFO_SUBJECT_GROUP)); |
| 285 AddKeyValue(table, row++, | 285 AddKeyValue(table, row++, |
| 286 l10n_util::GetStringUTF8(IDS_CERT_INFO_COMMON_NAME_LABEL), | 286 l10n_util::GetStringUTF8(IDS_CERT_INFO_COMMON_NAME_LABEL), |
| 287 Stringize(CERT_GetCommonName(&cert->subject))); | 287 psm::ProcessIDN(Stringize(CERT_GetCommonName(&cert->subject)))); |
| 288 AddKeyValue(table, row++, | 288 AddKeyValue(table, row++, |
| 289 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATION_LABEL), | 289 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATION_LABEL), |
| 290 Stringize(CERT_GetOrgName(&cert->subject))); | 290 Stringize(CERT_GetOrgName(&cert->subject))); |
| 291 AddKeyValue(table, row++, | 291 AddKeyValue(table, row++, |
| 292 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATIONAL_UNIT_LABEL), | 292 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATIONAL_UNIT_LABEL), |
| 293 Stringize(CERT_GetOrgUnitName(&cert->subject))); | 293 Stringize(CERT_GetOrgUnitName(&cert->subject))); |
| 294 AddKeyValue(table, row++, | 294 AddKeyValue(table, row++, |
| 295 l10n_util::GetStringUTF8(IDS_CERT_INFO_SERIAL_NUMBER_LABEL), | 295 l10n_util::GetStringUTF8(IDS_CERT_INFO_SERIAL_NUMBER_LABEL), |
| 296 Stringize(CERT_Hexify(&cert->serialNumber, TRUE))); | 296 Stringize(CERT_Hexify(&cert->serialNumber, TRUE))); |
| 297 | 297 |
| 298 row += 2; // Add spacing (kControlSpacing * 3 == kContentAreaSpacing). | 298 row += 2; // Add spacing (kControlSpacing * 3 == kContentAreaSpacing). |
| 299 | 299 |
| 300 AddTitle(table, row++, | 300 AddTitle(table, row++, |
| 301 l10n_util::GetStringUTF8(IDS_CERT_INFO_ISSUER_GROUP)); | 301 l10n_util::GetStringUTF8(IDS_CERT_INFO_ISSUER_GROUP)); |
| 302 AddKeyValue(table, row++, | 302 AddKeyValue(table, row++, |
| 303 l10n_util::GetStringUTF8(IDS_CERT_INFO_COMMON_NAME_LABEL), | 303 l10n_util::GetStringUTF8(IDS_CERT_INFO_COMMON_NAME_LABEL), |
| 304 Stringize(CERT_GetCommonName(&cert->issuer))); | 304 psm::ProcessIDN(Stringize(CERT_GetCommonName(&cert->issuer)))); |
| 305 AddKeyValue(table, row++, | 305 AddKeyValue(table, row++, |
| 306 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATION_LABEL), | 306 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATION_LABEL), |
| 307 Stringize(CERT_GetOrgName(&cert->issuer))); | 307 Stringize(CERT_GetOrgName(&cert->issuer))); |
| 308 AddKeyValue(table, row++, | 308 AddKeyValue(table, row++, |
| 309 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATIONAL_UNIT_LABEL), | 309 l10n_util::GetStringUTF8(IDS_CERT_INFO_ORGANIZATIONAL_UNIT_LABEL), |
| 310 Stringize(CERT_GetOrgUnitName(&cert->issuer))); | 310 Stringize(CERT_GetOrgUnitName(&cert->issuer))); |
| 311 | 311 |
| 312 row += 2; // Add spacing (kControlSpacing * 3 == kContentAreaSpacing). | 312 row += 2; // Add spacing (kControlSpacing * 3 == kContentAreaSpacing). |
| 313 | 313 |
| 314 PRTime issued, expires; | 314 PRTime issued, expires; |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 void ShowCertificateViewer(gfx::NativeWindow parent, int cert_id) { | 734 void ShowCertificateViewer(gfx::NativeWindow parent, int cert_id) { |
| 735 scoped_refptr<net::X509Certificate> cert; | 735 scoped_refptr<net::X509Certificate> cert; |
| 736 CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert); | 736 CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert); |
| 737 if (!cert.get()) { | 737 if (!cert.get()) { |
| 738 // The certificate was not found. Could be that the renderer crashed before | 738 // The certificate was not found. Could be that the renderer crashed before |
| 739 // we displayed the page info. | 739 // we displayed the page info. |
| 740 return; | 740 return; |
| 741 } | 741 } |
| 742 ShowCertificateViewer(parent, cert->os_cert_handle()); | 742 ShowCertificateViewer(parent, cert->os_cert_handle()); |
| 743 } | 743 } |
| OLD | NEW |