Chromium Code Reviews| Index: chrome/browser/ssl/ssl_client_auth_observer.h |
| diff --git a/chrome/browser/ssl/ssl_client_auth_observer.h b/chrome/browser/ssl/ssl_client_auth_observer.h |
| index 62e3fde9ddfd8c4c161768ef423895508b054379..189a66adc168c465fdaca32b394ea6981efc738c 100644 |
| --- a/chrome/browser/ssl/ssl_client_auth_observer.h |
| +++ b/chrome/browser/ssl/ssl_client_auth_observer.h |
| @@ -7,6 +7,7 @@ |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| @@ -17,6 +18,7 @@ class X509Certificate; |
| namespace content { |
| class BrowserContext; |
| +class ClientCertificateDelegate; |
| } |
| class SSLClientAuthObserver : public content::NotificationObserver { |
|
mmenke
2015/02/13 19:35:53
While you're here, mind documenting this class? T
davidben
2015/02/13 22:04:11
Done.
|
| @@ -24,17 +26,20 @@ class SSLClientAuthObserver : public content::NotificationObserver { |
| SSLClientAuthObserver( |
| const content::BrowserContext* browser_context, |
| const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, |
| - const base::Callback<void(net::X509Certificate*)>& callback); |
| + scoped_ptr<content::ClientCertificateDelegate> delegate); |
| ~SSLClientAuthObserver() override; |
| // UI should implement this to close the dialog. |
| virtual void OnCertSelectedByNotification() = 0; |
| - // Send content the certificate. Can also call with NULL if the user |
| - // cancelled. Derived classes must use this instead of caching the callback |
| - // and calling it directly. |
| + // Continues the request with a certificate. Can also call with NULL to |
| + // continue with no certificate. Derived classes must use this instead of |
| + // caching the delegate and calling it directly. |
| void CertificateSelected(net::X509Certificate* cert); |
| + // Cancels the certificate selection and aborts the request. |
| + void CancelCertificateSelection(); |
| + |
| // Begins observing notifications from other SSLClientAuthHandler instances. |
| // If another instance chooses a cert for a matching SSLCertRequestInfo, we |
| // will also use the same cert and OnCertSelectedByNotification will be called |
| @@ -57,7 +62,7 @@ class SSLClientAuthObserver : public content::NotificationObserver { |
| const content::BrowserContext* browser_context_; |
| scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
| - base::Callback<void(net::X509Certificate*)> callback_; |
| + scoped_ptr<content::ClientCertificateDelegate> delegate_; |
| content::NotificationRegistrar notification_registrar_; |
| DISALLOW_COPY_AND_ASSIGN(SSLClientAuthObserver); |