| 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..296f75c882857e5a441cb9c6878f76a5ddda33a9 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,46 @@ 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);
|
| +
|
| + // Gets the details for a specific certificate in the certificate chain. Calls
|
| + // the javascript function cert_viewer.getCertificateFields with a tree
|
| + // structure containing the fields and values for certain nodes.
|
| + //
|
| + // 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 cert_viewer.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_
|
|
|