| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/callback_forward.h" |
| 11 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "content/public/browser/render_view_host_delegate.h" | 14 #include "content/public/browser/render_view_host_delegate.h" |
| 14 | 15 |
| 15 class SSLAddCertHandler; | 16 class SSLAddCertHandler; |
| 16 class SSLClientAuthHandler; | |
| 17 class TabContentsWrapper; | 17 class TabContentsWrapper; |
| 18 | 18 |
| 19 namespace net { |
| 20 class HttpNetworkSession; |
| 21 class SSLCertRequestInfo; |
| 22 class X509Certificate; |
| 23 } |
| 24 |
| 19 class TabContentsSSLHelper { | 25 class TabContentsSSLHelper { |
| 20 public: | 26 public: |
| 21 explicit TabContentsSSLHelper(TabContentsWrapper* tab_contents); | 27 explicit TabContentsSSLHelper(TabContentsWrapper* tab_contents); |
| 22 virtual ~TabContentsSSLHelper(); | 28 virtual ~TabContentsSSLHelper(); |
| 23 | 29 |
| 24 // Called when |handler| encounters an error in verifying a received client | 30 // Called when |handler| encounters an error in verifying a received client |
| 25 // certificate. Note that, because CAs often will not send us intermediate | 31 // certificate. Note that, because CAs often will not send us intermediate |
| 26 // certificates, the verification we can do is minimal: we verify the | 32 // certificates, the verification we can do is minimal: we verify the |
| 27 // certificate is parseable, that we have the corresponding private key, and | 33 // certificate is parseable, that we have the corresponding private key, and |
| 28 // that the certificate has not expired. | 34 // that the certificate has not expired. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 43 scoped_refptr<SSLAddCertHandler> handler, int error_code); | 49 scoped_refptr<SSLAddCertHandler> handler, int error_code); |
| 44 | 50 |
| 45 // Called when |handler| has completed, so the delegate may release any state | 51 // Called when |handler| has completed, so the delegate may release any state |
| 46 // accumulated. | 52 // accumulated. |
| 47 void OnAddClientCertificateFinished( | 53 void OnAddClientCertificateFinished( |
| 48 scoped_refptr<SSLAddCertHandler> handler); | 54 scoped_refptr<SSLAddCertHandler> handler); |
| 49 | 55 |
| 50 // Displays a dialog for selecting a client certificate and returns it to | 56 // Displays a dialog for selecting a client certificate and returns it to |
| 51 // the |handler|. | 57 // the |handler|. |
| 52 void ShowClientCertificateRequestDialog( | 58 void ShowClientCertificateRequestDialog( |
| 53 scoped_refptr<SSLClientAuthHandler> handler); | 59 const net::HttpNetworkSession* network_session, |
| 60 net::SSLCertRequestInfo* cert_request_info, |
| 61 const base::Callback<void(net::X509Certificate*)>& callback); |
| 54 | 62 |
| 55 private: | 63 private: |
| 56 TabContentsWrapper* tab_contents_; | 64 TabContentsWrapper* tab_contents_; |
| 57 | 65 |
| 58 class SSLAddCertData; | 66 class SSLAddCertData; |
| 59 std::map<int, linked_ptr<SSLAddCertData> > request_id_to_add_cert_data_; | 67 std::map<int, linked_ptr<SSLAddCertData> > request_id_to_add_cert_data_; |
| 60 | 68 |
| 61 SSLAddCertData* GetAddCertData(SSLAddCertHandler* handler); | 69 SSLAddCertData* GetAddCertData(SSLAddCertHandler* handler); |
| 62 | 70 |
| 63 DISALLOW_COPY_AND_ASSIGN(TabContentsSSLHelper); | 71 DISALLOW_COPY_AND_ASSIGN(TabContentsSSLHelper); |
| 64 }; | 72 }; |
| 65 | 73 |
| 66 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ | 74 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ |
| OLD | NEW |