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

Unified Diff: chrome/browser/ui/webui/certificate_viewer.h

Issue 7528027: Add export function to WebUI certificate viewer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/certificate_viewer.h
diff --git a/chrome/browser/ui/webui/certificate_viewer.h b/chrome/browser/ui/webui/certificate_viewer.h
index bc52b416a087919d26e68d8b586e710593b91966..30544562f0129f6a0ae68eb6ad4d2648da331876 100644
--- a/chrome/browser/ui/webui/certificate_viewer.h
+++ b/chrome/browser/ui/webui/certificate_viewer.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_H_
#pragma once
+#include "base/values.h"
#include "chrome/browser/ui/webui/html_dialog_ui.h"
#include "net/base/x509_certificate.h"
#include "ui/gfx/native_widget_types.h"
@@ -47,13 +48,45 @@ class CertificateViewerDialog : private HtmlDialogUIDelegate {
// The certificate being viewed.
scoped_refptr<net::X509Certificate> cert_;
- // The argument string for the dialog which passes the certificate pointer.
- std::string json_args_;
-
// The title of the certificate viewer dialog, Certificate Viewer: CN.
string16 title_;
DISALLOW_COPY_AND_ASSIGN(CertificateViewerDialog);
};
+// Dialog handler which handles calls from the JS WebUI code to view certificate
+// details and export the certificate.
+class CertificateViewerDialogHandler : public WebUIMessageHandler {
+ public:
+ explicit CertificateViewerDialogHandler(net::X509Certificate* cert);
+
+ // Overridden from WebUIMessageHandler
+ virtual void RegisterMessages();
+
+ private:
+ // Brings up the export certificate dialog for the chosen certificate in the
+ // chain.
+ //
+ // The input is an integer index to the certificate in the chain to export.
+ void ExportCertificate(const base::ListValue* args);
+
+ // Get the details for a specific certificate in the certificate chain. The
+ // fields are returned as a tree structure with values for certain nodes.
Rick Byers 2011/08/09 17:29:18 mention the particular callback that is invoked he
flackr 2011/08/09 18:25:15 Done.
+ //
+ // The input is an integer index to the certificate in the chain to view.
+ void RequestCertificateFields(const base::ListValue* args);
+
+ // Extracts the certificate details and returns them to the javascript
+ // function getCertificateInfo in a dictionary structure.
+ void RequestCertificateInfo(const base::ListValue* args);
+
+ // The certificate being viewed.
+ scoped_refptr<net::X509Certificate> cert_;
+
+ // The certificate chain.
+ net::X509Certificate::OSCertHandles cert_chain_;
+
+ DISALLOW_COPY_AND_ASSIGN(CertificateViewerDialogHandler);
+};
+
#endif // CHROME_BROWSER_UI_WEBUI_CERTIFICATE_VIEWER_H_

Powered by Google App Engine
This is Rietveld 408576698