OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "net/base/ssl_cert_request_info.h" | 10 #include "net/base/ssl_cert_request_info.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 // Asks the user to select a certificate and resumes the URL request with that | 27 // Asks the user to select a certificate and resumes the URL request with that |
28 // certificate. | 28 // certificate. |
29 // Should only be called on the IO thread. | 29 // Should only be called on the IO thread. |
30 void SelectCertificate(); | 30 void SelectCertificate(); |
31 | 31 |
32 // Invoked when the request associated with this handler is cancelled. | 32 // Invoked when the request associated with this handler is cancelled. |
33 // Should only be called on the IO thread. | 33 // Should only be called on the IO thread. |
34 void OnRequestCancelled(); | 34 void OnRequestCancelled(); |
35 | 35 |
| 36 // Calls DoCertificateSelected on the I/O thread. |
| 37 // Called on the UI thread after the user has made a selection (which may |
| 38 // be long after DoSelectCertificate returns, if the UI is modeless/async.) |
| 39 void CertificateSelected(net::X509Certificate* cert); |
| 40 |
36 private: | 41 private: |
37 friend class base::RefCountedThreadSafe<SSLClientAuthHandler>; | 42 friend class base::RefCountedThreadSafe<SSLClientAuthHandler>; |
38 | 43 |
39 ~SSLClientAuthHandler(); | 44 ~SSLClientAuthHandler(); |
40 | 45 |
41 // Asks the user for a cert. | 46 // Asks the user for a cert. |
42 // Called on the UI thread. | 47 // Called on the UI thread. |
43 void DoSelectCertificate(); | 48 void DoSelectCertificate(); |
44 | 49 |
45 // Calls DoCertificateSelected on the I/O thread. | |
46 // Called on the UI thread after the user has made a selection (which may | |
47 // be long after DoSelectCertificate returns, if the UI is modeless/async.) | |
48 void CertificateSelected(net::X509Certificate* cert); | |
49 | |
50 // Notifies that the user has selected a cert. | 50 // Notifies that the user has selected a cert. |
51 // Called on the IO thread. | 51 // Called on the IO thread. |
52 void DoCertificateSelected(net::X509Certificate* cert); | 52 void DoCertificateSelected(net::X509Certificate* cert); |
53 | 53 |
54 // The URLRequest that triggered this client auth. | 54 // The URLRequest that triggered this client auth. |
55 URLRequest* request_; | 55 URLRequest* request_; |
56 | 56 |
57 // The certs to choose from. | 57 // The certs to choose from. |
58 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; | 58 scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); | 60 DISALLOW_COPY_AND_ASSIGN(SSLClientAuthHandler); |
61 }; | 61 }; |
62 | 62 |
63 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ | 63 #endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_HANDLER_H_ |
OLD | NEW |