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 CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
6 #define CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "net/base/x509_certificate.h" | 13 #include "net/base/x509_certificate.h" |
14 | 14 |
| 15 class SSLHostState; |
| 16 |
| 17 namespace content { |
15 class NavigationControllerImpl; | 18 class NavigationControllerImpl; |
16 class SSLHostState; | 19 } |
17 | 20 |
18 class SSLPolicyBackend { | 21 class SSLPolicyBackend { |
19 public: | 22 public: |
20 explicit SSLPolicyBackend(NavigationControllerImpl* controller); | 23 explicit SSLPolicyBackend(content::NavigationControllerImpl* controller); |
21 | 24 |
22 // Records that a host has run insecure content. | 25 // Records that a host has run insecure content. |
23 void HostRanInsecureContent(const std::string& host, int pid); | 26 void HostRanInsecureContent(const std::string& host, int pid); |
24 | 27 |
25 // Returns whether the specified host ran insecure content. | 28 // Returns whether the specified host ran insecure content. |
26 bool DidHostRunInsecureContent(const std::string& host, int pid) const; | 29 bool DidHostRunInsecureContent(const std::string& host, int pid) const; |
27 | 30 |
28 // Records that |cert| is permitted to be used for |host| in the future. | 31 // Records that |cert| is permitted to be used for |host| in the future. |
29 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); | 32 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); |
30 | 33 |
31 // Records that |cert| is not permitted to be used for |host| in the future. | 34 // Records that |cert| is not permitted to be used for |host| in the future. |
32 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); | 35 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); |
33 | 36 |
34 // Queries whether |cert| is allowed or denied for |host|. | 37 // Queries whether |cert| is allowed or denied for |host|. |
35 net::CertPolicy::Judgment QueryPolicy( | 38 net::CertPolicy::Judgment QueryPolicy( |
36 net::X509Certificate* cert, const std::string& host); | 39 net::X509Certificate* cert, const std::string& host); |
37 | 40 |
38 private: | 41 private: |
39 // SSL state specific for each host. | 42 // SSL state specific for each host. |
40 SSLHostState* ssl_host_state_; | 43 SSLHostState* ssl_host_state_; |
41 | 44 |
42 NavigationControllerImpl* controller_; | 45 content::NavigationControllerImpl* controller_; |
43 | 46 |
44 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); | 47 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); |
45 }; | 48 }; |
46 | 49 |
47 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 50 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
OLD | NEW |