| 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/callback_forward.h" |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 | 14 |
| 15 class SSLAddCertHandler; | 15 class SSLAddCertHandler; |
| 16 class TabContents; | 16 class TabContents; |
| 17 typedef TabContents TabContentsWrapper; | |
| 18 | 17 |
| 19 namespace net { | 18 namespace net { |
| 20 class HttpNetworkSession; | 19 class HttpNetworkSession; |
| 21 class SSLCertRequestInfo; | 20 class SSLCertRequestInfo; |
| 22 class X509Certificate; | 21 class X509Certificate; |
| 23 } | 22 } |
| 24 | 23 |
| 25 class TabContentsSSLHelper { | 24 class TabContentsSSLHelper { |
| 26 public: | 25 public: |
| 27 explicit TabContentsSSLHelper(TabContentsWrapper* tab_contents); | 26 explicit TabContentsSSLHelper(TabContents* tab_contents); |
| 28 virtual ~TabContentsSSLHelper(); | 27 virtual ~TabContentsSSLHelper(); |
| 29 | 28 |
| 30 // Called when |handler| encounters an error in verifying a received client | 29 // Called when |handler| encounters an error in verifying a received client |
| 31 // certificate. Note that, because CAs often will not send us intermediate | 30 // certificate. Note that, because CAs often will not send us intermediate |
| 32 // certificates, the verification we can do is minimal: we verify the | 31 // certificates, the verification we can do is minimal: we verify the |
| 33 // certificate is parseable, that we have the corresponding private key, and | 32 // certificate is parseable, that we have the corresponding private key, and |
| 34 // that the certificate has not expired. | 33 // that the certificate has not expired. |
| 35 void OnVerifyClientCertificateError( | 34 void OnVerifyClientCertificateError( |
| 36 scoped_refptr<SSLAddCertHandler> handler, int error_code); | 35 scoped_refptr<SSLAddCertHandler> handler, int error_code); |
| 37 | 36 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 54 scoped_refptr<SSLAddCertHandler> handler); | 53 scoped_refptr<SSLAddCertHandler> handler); |
| 55 | 54 |
| 56 // Displays a dialog for selecting a client certificate and returns it to | 55 // Displays a dialog for selecting a client certificate and returns it to |
| 57 // the |handler|. | 56 // the |handler|. |
| 58 void ShowClientCertificateRequestDialog( | 57 void ShowClientCertificateRequestDialog( |
| 59 const net::HttpNetworkSession* network_session, | 58 const net::HttpNetworkSession* network_session, |
| 60 net::SSLCertRequestInfo* cert_request_info, | 59 net::SSLCertRequestInfo* cert_request_info, |
| 61 const base::Callback<void(net::X509Certificate*)>& callback); | 60 const base::Callback<void(net::X509Certificate*)>& callback); |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 TabContentsWrapper* tab_contents_; | 63 TabContents* tab_contents_; |
| 65 | 64 |
| 66 class SSLAddCertData; | 65 class SSLAddCertData; |
| 67 std::map<int, linked_ptr<SSLAddCertData> > request_id_to_add_cert_data_; | 66 std::map<int, linked_ptr<SSLAddCertData> > request_id_to_add_cert_data_; |
| 68 | 67 |
| 69 SSLAddCertData* GetAddCertData(SSLAddCertHandler* handler); | 68 SSLAddCertData* GetAddCertData(SSLAddCertHandler* handler); |
| 70 | 69 |
| 71 DISALLOW_COPY_AND_ASSIGN(TabContentsSSLHelper); | 70 DISALLOW_COPY_AND_ASSIGN(TabContentsSSLHelper); |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ | 73 #endif // CHROME_BROWSER_TAB_CONTENTS_TAB_CONTENTS_SSL_HELPER_H_ |
| OLD | NEW |