OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_ADD_CERT_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ |
6 #define CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 | 11 |
12 namespace net { | 12 namespace net { |
| 13 class URLRequest; |
13 class X509Certificate; | 14 class X509Certificate; |
14 } | 15 } |
15 class URLRequest; | |
16 | 16 |
17 // This class handles adding a newly-generated client cert. It ensures there's a | 17 // This class handles adding a newly-generated client cert. It ensures there's a |
18 // private key for the cert, displays the cert to the user, and adds it upon | 18 // private key for the cert, displays the cert to the user, and adds it upon |
19 // user approval. | 19 // user approval. |
20 // It is self-owned and deletes itself when finished. | 20 // It is self-owned and deletes itself when finished. |
21 class SSLAddCertHandler : public base::RefCountedThreadSafe<SSLAddCertHandler> { | 21 class SSLAddCertHandler : public base::RefCountedThreadSafe<SSLAddCertHandler> { |
22 public: | 22 public: |
23 SSLAddCertHandler(URLRequest* request, net::X509Certificate* cert, | 23 SSLAddCertHandler(net::URLRequest* request, net::X509Certificate* cert, |
24 int render_process_host_id, int render_view_id); | 24 int render_process_host_id, int render_view_id); |
25 | 25 |
26 net::X509Certificate* cert() { return cert_; } | 26 net::X509Certificate* cert() { return cert_; } |
27 | 27 |
28 int network_request_id() const { return network_request_id_; } | 28 int network_request_id() const { return network_request_id_; } |
29 | 29 |
30 // The platform-specific code calls this when it's done, to clean up. | 30 // The platform-specific code calls this when it's done, to clean up. |
31 // If |addCert| is true, the cert will be added to the CertDatabase. | 31 // If |addCert| is true, the cert will be added to the CertDatabase. |
32 void Finished(bool add_cert); | 32 void Finished(bool add_cert); |
33 | 33 |
(...skipping 15 matching lines...) Expand all Loading... |
49 int network_request_id_; | 49 int network_request_id_; |
50 // The id of the |RenderProcessHost| which started the download. | 50 // The id of the |RenderProcessHost| which started the download. |
51 int render_process_host_id_; | 51 int render_process_host_id_; |
52 // The id of the |RenderView| which started the download. | 52 // The id of the |RenderView| which started the download. |
53 int render_view_id_; | 53 int render_view_id_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(SSLAddCertHandler); | 55 DISALLOW_COPY_AND_ASSIGN(SSLAddCertHandler); |
56 }; | 56 }; |
57 | 57 |
58 #endif // CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ | 58 #endif // CHROME_BROWSER_SSL_SSL_ADD_CERT_HANDLER_H_ |
OLD | NEW |