diff options
author | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-07 22:55:27 +0000 |
---|---|---|
committer | davidben@chromium.org <davidben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-07 22:55:27 +0000 |
commit | 8ae178b1da02c2ab5104060a711c305cb826221d (patch) | |
tree | ad8f723b09064d68239d6db01bf0c7532831137d /chrome/browser/gtk | |
parent | 4fe95a617e494a2e279d9d623816f3e3b7aed944 (diff) | |
download | chromium_src-8ae178b1da02c2ab5104060a711c305cb826221d.zip chromium_src-8ae178b1da02c2ab5104060a711c305cb826221d.tar.gz chromium_src-8ae178b1da02c2ab5104060a711c305cb826221d.tar.bz2 |
Refactor certificate viewer code behind ShowCertificateViewer
This abstracts away the platform-specific certificate viewer behind a common
function call.
R=wtc,mattm
BUG=none
TEST=Viewing the certificate information on an SSL session continues to work
Review URL: http://codereview.chromium.org/2815024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/certificate_viewer.cc | 12 | ||||
-rw-r--r-- | chrome/browser/gtk/certificate_viewer.h | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/page_info_window_gtk.cc | 4 |
3 files changed, 6 insertions, 12 deletions
diff --git a/chrome/browser/gtk/certificate_viewer.cc b/chrome/browser/gtk/certificate_viewer.cc index c1e98d4..bb9312d 100644 --- a/chrome/browser/gtk/certificate_viewer.cc +++ b/chrome/browser/gtk/certificate_viewer.cc @@ -20,13 +20,13 @@ #include "base/string_util.h" #include "base/time.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/cert_store.h" #include "chrome/browser/gtk/certificate_dialogs.h" #include "chrome/browser/gtk/gtk_util.h" #include "chrome/third_party/mozilla_security_manager/nsNSSCertHelper.h" #include "chrome/third_party/mozilla_security_manager/nsNSSCertificate.h" #include "chrome/third_party/mozilla_security_manager/nsUsageArrayHelper.h" #include "grit/generated_resources.h" +#include "net/base/x509_certificate.h" // PSM = Mozilla's Personal Security Manager. namespace psm = mozilla_security_manager; @@ -732,13 +732,7 @@ void ShowCertificateViewer(gfx::NativeWindow parent, CERTCertificate* cert) { (new CertificateViewer(parent, cert_chain))->Show(); } -void ShowCertificateViewer(gfx::NativeWindow parent, int cert_id) { - scoped_refptr<net::X509Certificate> cert; - CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert); - if (!cert.get()) { - // The certificate was not found. Could be that the renderer crashed before - // we displayed the page info. - return; - } +void ShowCertificateViewer(gfx::NativeWindow parent, + net::X509Certificate* cert) { ShowCertificateViewer(parent, cert->os_cert_handle()); } diff --git a/chrome/browser/gtk/certificate_viewer.h b/chrome/browser/gtk/certificate_viewer.h index 4f801c3..24e69b9 100644 --- a/chrome/browser/gtk/certificate_viewer.h +++ b/chrome/browser/gtk/certificate_viewer.h @@ -5,11 +5,11 @@ #ifndef CHROME_BROWSER_GTK_CERTIFICATE_VIEWER_H_ #define CHROME_BROWSER_GTK_CERTIFICATE_VIEWER_H_ +#include "chrome/browser/certificate_viewer.h" #include "gfx/native_widget_types.h" typedef struct CERTCertificateStr CERTCertificate; void ShowCertificateViewer(gfx::NativeWindow parent, CERTCertificate* cert); -void ShowCertificateViewer(gfx::NativeWindow parent, int cert_id); #endif // CHROME_BROWSER_GTK_CERTIFICATE_VIEWER_H_ diff --git a/chrome/browser/gtk/page_info_window_gtk.cc b/chrome/browser/gtk/page_info_window_gtk.cc index 1409a89..ada3f81 100644 --- a/chrome/browser/gtk/page_info_window_gtk.cc +++ b/chrome/browser/gtk/page_info_window_gtk.cc @@ -10,7 +10,7 @@ #include "app/resource_bundle.h" #include "base/compiler_specific.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/gtk/certificate_viewer.h" +#include "chrome/browser/certificate_viewer.h" #include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/page_info_model.h" #include "chrome/browser/page_info_window.h" @@ -192,7 +192,7 @@ void PageInfoWindowGtk::Show() { } void PageInfoWindowGtk::ShowCertDialog() { - ShowCertificateViewer(GTK_WINDOW(dialog_), cert_id_); + ShowCertificateViewerByID(GTK_WINDOW(dialog_), cert_id_); } } // namespace |