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/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "content/public/browser/ssl_host_state_delegate.h" | 13 #include "content/public/browser/ssl_host_state_delegate.h" |
14 #include "net/cert/cert_status_flags.h" | 14 #include "net/cert/cert_status_flags.h" |
15 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class NavigationControllerImpl; | 18 class NavigationControllerImpl; |
19 | 19 |
20 class SSLPolicyBackend { | 20 class SSLPolicyBackend { |
21 public: | 21 public: |
22 explicit SSLPolicyBackend(NavigationControllerImpl* controller); | 22 explicit SSLPolicyBackend(NavigationControllerImpl* controller); |
23 | 23 |
24 // Records that a host has run insecure content. | 24 // Records that a host has run insecure content. |
25 void HostRanInsecureContent(const std::string& host, int pid); | 25 void HostRanInsecureContent(const std::string& host, int pid); |
26 | 26 |
27 // Returns whether the specified host ran insecure content. | 27 // Returns whether the specified host ran insecure content. |
28 bool DidHostRunInsecureContent(const std::string& host, int pid) const; | 28 bool DidHostRunInsecureContent(const std::string& host, int pid) const; |
29 | 29 |
30 // Revokes all allow exceptions by by the user for |host|. | |
felt
2015/04/09 21:57:28
nit: by by
jww
2015/04/16 23:59:07
Done.
| |
31 void RevokeUserAllowExceptions(const std::string& host); | |
32 | |
30 // Records that |cert| is permitted to be used for |host| in the future, for | 33 // Records that |cert| is permitted to be used for |host| in the future, for |
31 // a specific error type. | 34 // a specific error type. |
32 void AllowCertForHost(const net::X509Certificate& cert, | 35 void AllowCertForHost(const net::X509Certificate& cert, |
33 const std::string& host, | 36 const std::string& host, |
34 net::CertStatus error); | 37 net::CertStatus error); |
35 | 38 |
36 // Queries whether |cert| is allowed for |host|. Returns true in | 39 // Queries whether |cert| is allowed for |host|. Returns true in |
37 // |expired_previous_decision| if a user decision had been made previously but | 40 // |expired_previous_decision| if a user decision had been made previously but |
38 // that decision has expired, otherwise false. | 41 // that decision has expired, otherwise false. |
39 SSLHostStateDelegate::CertJudgment QueryPolicy( | 42 SSLHostStateDelegate::CertJudgment QueryPolicy( |
40 const net::X509Certificate& cert, | 43 const net::X509Certificate& cert, |
41 const std::string& host, | 44 const std::string& host, |
42 net::CertStatus error, | 45 net::CertStatus error, |
43 bool* expired_previous_decision); | 46 bool* expired_previous_decision); |
44 | 47 |
45 private: | 48 private: |
46 // SSL state delegate specific for each host. | 49 // SSL state delegate specific for each host. |
47 SSLHostStateDelegate* ssl_host_state_delegate_; | 50 SSLHostStateDelegate* ssl_host_state_delegate_; |
48 | 51 |
49 NavigationControllerImpl* controller_; | 52 NavigationControllerImpl* controller_; |
50 | 53 |
51 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); | 54 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); |
52 }; | 55 }; |
53 | 56 |
54 } // namespace content | 57 } // namespace content |
55 | 58 |
56 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 59 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
OLD | NEW |