| 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/callback_forward.h" |
| 10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 13 #include "net/cert/x509_certificate.h" | 14 #include "net/cert/x509_certificate.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 // The SSLHostStateDelegate encapulates the host-specific state for SSL errors. | 18 // The SSLHostStateDelegate encapulates the host-specific state for SSL errors. |
| 18 // For example, SSLHostStateDelegate remembers whether the user has whitelisted | 19 // For example, SSLHostStateDelegate remembers whether the user has whitelisted |
| 19 // a particular broken cert for use with particular host. We separate this | 20 // a particular broken cert for use with particular host. We separate this |
| (...skipping 24 matching lines...) Expand all Loading... |
| 44 // errors on an HTTPS page. | 45 // errors on an HTTPS page. |
| 45 CERT_ERRORS_CONTENT, | 46 CERT_ERRORS_CONTENT, |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 // Records that |cert| is permitted to be used for |host| in the future, for | 49 // Records that |cert| is permitted to be used for |host| in the future, for |
| 49 // a specified |error| type. | 50 // a specified |error| type. |
| 50 virtual void AllowCert(const std::string&, | 51 virtual void AllowCert(const std::string&, |
| 51 const net::X509Certificate& cert, | 52 const net::X509Certificate& cert, |
| 52 net::CertStatus error) = 0; | 53 net::CertStatus error) = 0; |
| 53 | 54 |
| 54 // Clear all allow preferences. | 55 // Clear allow preferences matched by |host_filter|. If the filter is null, |
| 55 virtual void Clear() = 0; | 56 // clear all preferences. |
| 57 virtual void Clear( |
| 58 const base::Callback<bool(const std::string&)>& host_filter) = 0; |
| 56 | 59 |
| 57 // Queries whether |cert| is allowed for |host| and |error|. Returns true in | 60 // Queries whether |cert| is allowed for |host| and |error|. Returns true in |
| 58 // |expired_previous_decision| if a previous user decision expired immediately | 61 // |expired_previous_decision| if a previous user decision expired immediately |
| 59 // prior to this query, otherwise false. | 62 // prior to this query, otherwise false. |
| 60 virtual CertJudgment QueryPolicy(const std::string& host, | 63 virtual CertJudgment QueryPolicy(const std::string& host, |
| 61 const net::X509Certificate& cert, | 64 const net::X509Certificate& cert, |
| 62 net::CertStatus error, | 65 net::CertStatus error, |
| 63 bool* expired_previous_decision) = 0; | 66 bool* expired_previous_decision) = 0; |
| 64 | 67 |
| 65 // Records that a host has run insecure content of the given |content_type|. | 68 // Records that a host has run insecure content of the given |content_type|. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 84 // error combination exception is allowed, use QueryPolicy(). | 87 // error combination exception is allowed, use QueryPolicy(). |
| 85 virtual bool HasAllowException(const std::string& host) const = 0; | 88 virtual bool HasAllowException(const std::string& host) const = 0; |
| 86 | 89 |
| 87 protected: | 90 protected: |
| 88 virtual ~SSLHostStateDelegate() {} | 91 virtual ~SSLHostStateDelegate() {} |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 } // namespace content | 94 } // namespace content |
| 92 | 95 |
| 93 #endif // CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ | 96 #endif // CONTENT_PUBLIC_BROWSER_SSL_HOST_STATE_DELEGATE_H_ |
| OLD | NEW |