| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_HOST_STATE_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ | 6 #define CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 // Returns whether the specified host was marked as broken. | 35 // Returns whether the specified host was marked as broken. |
| 36 bool DidMarkHostAsBroken(const std::string& host); | 36 bool DidMarkHostAsBroken(const std::string& host); |
| 37 | 37 |
| 38 // Records that |cert| is permitted to be used for |host| in the future. | 38 // Records that |cert| is permitted to be used for |host| in the future. |
| 39 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); | 39 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); |
| 40 | 40 |
| 41 // Records that |cert| is not permitted to be used for |host| in the future. | 41 // Records that |cert| is not permitted to be used for |host| in the future. |
| 42 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); | 42 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); |
| 43 | 43 |
| 44 // Queries whether there is at least one certificate that has been manually | |
| 45 // allowed for this host. | |
| 46 bool DidAllowCertForHost(const std::string& host); | |
| 47 | |
| 48 // Queries whether |cert| is allowed or denied for |host|. | 44 // Queries whether |cert| is allowed or denied for |host|. |
| 49 net::X509Certificate::Policy::Judgment QueryPolicy( | 45 net::X509Certificate::Policy::Judgment QueryPolicy( |
| 50 net::X509Certificate* cert, const std::string& host); | 46 net::X509Certificate* cert, const std::string& host); |
| 51 | 47 |
| 52 // Allows mixed content to be visible (non filtered). | 48 // Allows mixed content to be visible (non filtered). |
| 53 void AllowMixedContentForHost(const std::string& host); | 49 void AllowMixedContentForHost(const std::string& host); |
| 54 | 50 |
| 55 // Returns whether the specified host is allowed to show mixed content. | 51 // Returns whether the specified host is allowed to show mixed content. |
| 56 bool DidAllowMixedContentForHost(const std::string& host); | 52 bool DidAllowMixedContentForHost(const std::string& host); |
| 57 | 53 |
| 58 private: | 54 private: |
| 59 // Hosts which have been contaminated with unsafe content. | 55 // Hosts which have been contaminated with unsafe content. |
| 60 std::set<std::string> broken_hosts_; | 56 std::set<std::string> broken_hosts_; |
| 61 | 57 |
| 62 // Certificate policies for each host. | 58 // Certificate policies for each host. |
| 63 std::map<std::string, net::X509Certificate::Policy> cert_policy_for_host_; | 59 std::map<std::string, net::X509Certificate::Policy> cert_policy_for_host_; |
| 64 | 60 |
| 65 // Hosts for which we are allowed to show mixed content. | 61 // Hosts for which we are allowed to show mixed content. |
| 66 std::set<std::string> allow_mixed_content_for_host_; | 62 std::set<std::string> allow_mixed_content_for_host_; |
| 67 | 63 |
| 68 DISALLOW_COPY_AND_ASSIGN(SSLHostState); | 64 DISALLOW_COPY_AND_ASSIGN(SSLHostState); |
| 69 }; | 65 }; |
| 70 | 66 |
| 71 #endif // CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ | 67 #endif // CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| OLD | NEW |