Chromium Code Reviews| Index: chrome/browser/ui/views/certificate_selector.h |
| diff --git a/chrome/browser/ui/views/certificate_selector.h b/chrome/browser/ui/views/certificate_selector.h |
| index 5eb701a2287e5370db51f3151a33619944f490f3..1702510e2366a9dcdbe53be5e62ff277fc540e40 100644 |
| --- a/chrome/browser/ui/views/certificate_selector.h |
| +++ b/chrome/browser/ui/views/certificate_selector.h |
| @@ -9,7 +9,7 @@ |
| #include "base/macros.h" |
| #include "base/strings/string16.h" |
| -#include "net/cert/x509_certificate.h" |
| +#include "net/ssl/client_cert_identity.h" |
| #include "ui/views/controls/button/button.h" |
| #include "ui/views/controls/table/table_view_observer.h" |
| #include "ui/views/window/dialog_delegate.h" |
| @@ -45,13 +45,19 @@ class CertificateSelector : public views::DialogDelegateView, |
| static bool CanShow(content::WebContents* web_contents); |
| // |web_contents| must not be null. |
| - CertificateSelector(const net::CertificateList& certificates, |
| + CertificateSelector(net::ClientCertIdentityList identities, |
| content::WebContents* web_contents); |
| ~CertificateSelector() override; |
| + // Handles when the user chooses a certificate in the list. |
| + // This function should return true if the window can be closed after it |
| + // returns, or false if it must remain open. |
| + virtual bool AcceptCertificate( |
| + std::unique_ptr<net::ClientCertIdentity> identity) = 0; |
| + |
| // Returns the currently selected certificate or null if none is selected. |
| // Must be called after |InitWithText()|. |
| - net::X509Certificate* GetSelectedCert() const; |
| + net::ClientCertIdentity* GetSelectedCert() const; |
| // Shows this dialog as a constrained web modal dialog and focuses the first |
| // certificate. |
| @@ -59,6 +65,7 @@ class CertificateSelector : public views::DialogDelegateView, |
| void Show(); |
| // DialogDelegateView: |
| + bool Accept() override; |
| bool CanResize() const override; |
| base::string16 GetWindowTitle() const override; |
| bool IsDialogButtonEnabled(ui::DialogButton button) const override; |
| @@ -88,7 +95,11 @@ class CertificateSelector : public views::DialogDelegateView, |
| private: |
| class CertificateTableModel; |
| - net::CertificateList certificates_; |
| + net::ClientCertIdentityList identities_; |
| + |
| + // Whether a certificate has been selected. |identities_| should not be |
| + // accessed after this is true. |
| + bool certificate_accepted_ = false; |
|
Peter Kasting
2017/06/16 23:29:52
Nit: Not necessary if you don't want since the fil
mattm
2017/06/17 03:20:07
Done.
|
| // Whether to show the provider column in the table or not. Certificates |
| // provided by the platform show the empty string as provider. That column is |