| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual void Clear() = 0; | 41 virtual void Clear() = 0; |
| 42 | 42 |
| 43 // Queries whether |cert| is allowed for |host| and |error|. Returns true in | 43 // Queries whether |cert| is allowed for |host| and |error|. Returns true in |
| 44 // |expired_previous_decision| if a previous user decision expired immediately | 44 // |expired_previous_decision| if a previous user decision expired immediately |
| 45 // prior to this query, otherwise false. | 45 // prior to this query, otherwise false. |
| 46 virtual CertJudgment QueryPolicy(const std::string& host, | 46 virtual CertJudgment QueryPolicy(const std::string& host, |
| 47 const net::X509Certificate& cert, | 47 const net::X509Certificate& cert, |
| 48 net::CertStatus error, | 48 net::CertStatus error, |
| 49 bool* expired_previous_decision) = 0; | 49 bool* expired_previous_decision) = 0; |
| 50 | 50 |
| 51 // Records that a host has run insecure content. | 51 // Records that a host has run insecure (HTTP) content. |
| 52 virtual void HostRanInsecureContent(const std::string& host, int pid) = 0; | 52 virtual void HostRanInsecureContent(const std::string& host, int pid) = 0; |
| 53 | 53 |
| 54 // Returns whether the specified host ran insecure content. | 54 // Returns whether the specified host ran insecure (HTTP) content. |
| 55 virtual bool DidHostRunInsecureContent(const std::string& host, | 55 virtual bool DidHostRunInsecureContent(const std::string& host, |
| 56 int pid) const = 0; | 56 int pid) const = 0; |
| 57 | 57 |
| 58 // Records that a host has run content loaded over HTTPS with certificate |
| 59 // errors. |
| 60 virtual void HostRanContentWithCertificateErrors(const std::string& host, |
| 61 int pid) = 0; |
| 62 |
| 63 // Returns whether the specified host ran content loaded over HTTPS with |
| 64 // certificate errors. |
| 65 virtual bool DidHostRunContentWithCertificateErrors(const std::string& host, |
| 66 int pid) const = 0; |
| 67 |
| 58 // Revokes all SSL certificate error allow exceptions made by the user for | 68 // Revokes all SSL certificate error allow exceptions made by the user for |
| 59 // |host|. | 69 // |host|. |
| 60 virtual void RevokeUserAllowExceptions(const std::string& host) = 0; | 70 virtual void RevokeUserAllowExceptions(const std::string& host) = 0; |
| 61 | 71 |
| 62 // Returns whether the user has allowed a certificate error exception for | 72 // Returns whether the user has allowed a certificate error exception for |
| 63 // |host|. This does not mean that *all* certificate errors are allowed, just | 73 // |host|. This does not mean that *all* certificate errors are allowed, just |
| 64 // that there exists an exception. To see if a particular certificate and | 74 // that there exists an exception. To see if a particular certificate and |
| 65 // error combination exception is allowed, use QueryPolicy(). | 75 // error combination exception is allowed, use QueryPolicy(). |
| 66 virtual bool HasAllowException(const std::string& host) const = 0; | 76 virtual bool HasAllowException(const std::string& host) const = 0; |
| 67 | 77 |
| 68 protected: | 78 protected: |
| 69 virtual ~SSLHostStateDelegate() {} | 79 virtual ~SSLHostStateDelegate() {} |
| 70 }; | 80 }; |
| 71 | 81 |
| 72 } // namespace content | 82 } // namespace content |
| 73 | 83 |
| 74 #endif // CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ | 84 #endif // CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ |
| OLD | NEW |