| 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/macros.h" | 11 #include "base/macros.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 CONTENT_EXPORT SSLPolicyBackend { | 20 class CONTENT_EXPORT 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 // Records that a host has run content with certificate errors. |
| 31 void HostRanContentWithCertificateErrors(const std::string& host, int pid); |
| 32 |
| 33 // Returns whether the specified host ran content with certificate errors. |
| 34 bool DidHostRunContentWithCertificateErrors(const std::string& host, |
| 35 int pid) const; |
| 36 |
| 30 // Revokes all allow exceptions by the user for |host|. | 37 // Revokes all allow exceptions by the user for |host|. |
| 31 void RevokeUserAllowExceptions(const std::string& host); | 38 void RevokeUserAllowExceptions(const std::string& host); |
| 32 | 39 |
| 33 // Returns true if and only if a user exception has previously been made for | 40 // Returns true if and only if a user exception has previously been made for |
| 34 // |host|. | 41 // |host|. |
| 35 bool HasAllowException(const std::string& host); | 42 bool HasAllowException(const std::string& host); |
| 36 | 43 |
| 37 // Records that |cert| is permitted to be used for |host| in the future, for | 44 // Records that |cert| is permitted to be used for |host| in the future, for |
| 38 // a specific error type. | 45 // a specific error type. |
| 39 void AllowCertForHost(const net::X509Certificate& cert, | 46 void AllowCertForHost(const net::X509Certificate& cert, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 54 SSLHostStateDelegate* ssl_host_state_delegate_; | 61 SSLHostStateDelegate* ssl_host_state_delegate_; |
| 55 | 62 |
| 56 NavigationControllerImpl* controller_; | 63 NavigationControllerImpl* controller_; |
| 57 | 64 |
| 58 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); | 65 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); |
| 59 }; | 66 }; |
| 60 | 67 |
| 61 } // namespace content | 68 } // namespace content |
| 62 | 69 |
| 63 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ | 70 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ |
| OLD | NEW |