| 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_SSL_SSL_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | |
| 14 #include "content/public/browser/web_contents_user_data.h" | 13 #include "content/public/browser/web_contents_user_data.h" |
| 15 | 14 |
| 16 class SSLAddCertHandler; | 15 class SSLAddCertHandler; |
| 17 | 16 |
| 18 namespace net { | 17 namespace net { |
| 19 class HttpNetworkSession; | 18 class HttpNetworkSession; |
| 20 class SSLCertRequestInfo; | 19 class SSLCertRequestInfo; |
| 21 class X509Certificate; | 20 class X509Certificate; |
| 22 } | 21 } |
| 23 | 22 |
| 24 class SSLTabHelper : public content::WebContentsObserver, | 23 class SSLTabHelper : public content::WebContentsUserData<SSLTabHelper> { |
| 25 public content::WebContentsUserData<SSLTabHelper> { | |
| 26 public: | 24 public: |
| 27 virtual ~SSLTabHelper(); | 25 virtual ~SSLTabHelper(); |
| 28 | 26 |
| 29 // content::WebContentsObserver: | |
| 30 virtual void DidChangeVisibleSSLState() OVERRIDE; | |
| 31 | |
| 32 // Called when |handler| encounters an error in verifying a received client | 27 // Called when |handler| encounters an error in verifying a received client |
| 33 // certificate. Note that, because CAs often will not send us intermediate | 28 // certificate. Note that, because CAs often will not send us intermediate |
| 34 // certificates, the verification we can do is minimal: we verify the | 29 // certificates, the verification we can do is minimal: we verify the |
| 35 // certificate is parseable, that we have the corresponding private key, and | 30 // certificate is parseable, that we have the corresponding private key, and |
| 36 // that the certificate has not expired. | 31 // that the certificate has not expired. |
| 37 void OnVerifyClientCertificateError( | 32 void OnVerifyClientCertificateError( |
| 38 scoped_refptr<SSLAddCertHandler> handler, int error_code); | 33 scoped_refptr<SSLAddCertHandler> handler, int error_code); |
| 39 | 34 |
| 40 // Called when |handler| requests the user's confirmation in adding a client | 35 // Called when |handler| requests the user's confirmation in adding a client |
| 41 // certificate. | 36 // certificate. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 70 | 65 |
| 71 class SSLAddCertData; | 66 class SSLAddCertData; |
| 72 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_; |
| 73 | 68 |
| 74 SSLAddCertData* GetAddCertData(SSLAddCertHandler* handler); | 69 SSLAddCertData* GetAddCertData(SSLAddCertHandler* handler); |
| 75 | 70 |
| 76 DISALLOW_COPY_AND_ASSIGN(SSLTabHelper); | 71 DISALLOW_COPY_AND_ASSIGN(SSLTabHelper); |
| 77 }; | 72 }; |
| 78 | 73 |
| 79 #endif // CHROME_BROWSER_SSL_SSL_TAB_HELPER_H_ | 74 #endif // CHROME_BROWSER_SSL_SSL_TAB_HELPER_H_ |
| OLD | NEW |