| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ | 5 #ifndef COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ |
| 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ | 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // load. Content can be passive content that is displayed (such as | 87 // load. Content can be passive content that is displayed (such as |
| 88 // images) or active content that is run (such as scripts or iframes). | 88 // images) or active content that is run (such as scripts or iframes). |
| 89 enum ContentStatus { | 89 enum ContentStatus { |
| 90 CONTENT_STATUS_UNKNOWN, | 90 CONTENT_STATUS_UNKNOWN, |
| 91 CONTENT_STATUS_NONE, | 91 CONTENT_STATUS_NONE, |
| 92 CONTENT_STATUS_DISPLAYED, | 92 CONTENT_STATUS_DISPLAYED, |
| 93 CONTENT_STATUS_RAN, | 93 CONTENT_STATUS_RAN, |
| 94 CONTENT_STATUS_DISPLAYED_AND_RAN, | 94 CONTENT_STATUS_DISPLAYED_AND_RAN, |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // Describes whether the page contains malicious resources such as |
| 98 // malware or phishing attacks. |
| 99 enum MaliciousContentStatus { |
| 100 MALICIOUS_CONTENT_STATUS_NONE, |
| 101 MALICIOUS_CONTENT_STATUS_MALWARE, |
| 102 MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE, |
| 103 MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING, |
| 104 }; |
| 105 |
| 97 // Describes the security status of a page or request. This is the | 106 // Describes the security status of a page or request. This is the |
| 98 // main data structure provided by this class. | 107 // main data structure provided by this class. |
| 99 struct SecurityInfo { | 108 struct SecurityInfo { |
| 100 SecurityInfo(); | 109 SecurityInfo(); |
| 101 ~SecurityInfo(); | 110 ~SecurityInfo(); |
| 102 SecurityLevel security_level; | 111 SecurityLevel security_level; |
| 103 // True if the page fails the browser's malware or phishing checks. | 112 // Describes the nature of the page's malicious content, if any. |
| 104 bool fails_malware_check; | 113 MaliciousContentStatus malicious_content_status; |
| 105 SHA1DeprecationStatus sha1_deprecation_status; | 114 SHA1DeprecationStatus sha1_deprecation_status; |
| 106 // |mixed_content_status| describes the presence of content that was | 115 // |mixed_content_status| describes the presence of content that was |
| 107 // loaded over a nonsecure (HTTP) connection. | 116 // loaded over a nonsecure (HTTP) connection. |
| 108 ContentStatus mixed_content_status; | 117 ContentStatus mixed_content_status; |
| 109 // |content_with_cert_errors_status| describes the presence of | 118 // |content_with_cert_errors_status| describes the presence of |
| 110 // content that was loaded over an HTTPS connection with | 119 // content that was loaded over an HTTPS connection with |
| 111 // certificate errors. | 120 // certificate errors. |
| 112 ContentStatus content_with_cert_errors_status; | 121 ContentStatus content_with_cert_errors_status; |
| 113 // The verification statuses of the signed certificate timestamps | 122 // The verification statuses of the signed certificate timestamps |
| 114 // for the connection. | 123 // for the connection. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 155 |
| 147 // Contains the security state relevant to computing the SecurityInfo | 156 // Contains the security state relevant to computing the SecurityInfo |
| 148 // for a page. This is the input to GetSecurityInfo() provided by the | 157 // for a page. This is the input to GetSecurityInfo() provided by the |
| 149 // model's client. | 158 // model's client. |
| 150 struct VisibleSecurityState { | 159 struct VisibleSecurityState { |
| 151 VisibleSecurityState(); | 160 VisibleSecurityState(); |
| 152 ~VisibleSecurityState(); | 161 ~VisibleSecurityState(); |
| 153 bool operator==(const VisibleSecurityState& other) const; | 162 bool operator==(const VisibleSecurityState& other) const; |
| 154 GURL url; | 163 GURL url; |
| 155 | 164 |
| 156 // True if the page fails the browser's malware or phishing checks. | 165 MaliciousContentStatus malicious_content_status; |
| 157 bool fails_malware_check; | |
| 158 | 166 |
| 159 // CONNECTION SECURITY FIELDS | 167 // CONNECTION SECURITY FIELDS |
| 160 // Whether the connection security fields are initialized. | 168 // Whether the connection security fields are initialized. |
| 161 bool connection_info_initialized; | 169 bool connection_info_initialized; |
| 162 // The following fields contain information about the connection | 170 // The following fields contain information about the connection |
| 163 // used to load the page or request. | 171 // used to load the page or request. |
| 164 scoped_refptr<net::X509Certificate> certificate; | 172 scoped_refptr<net::X509Certificate> certificate; |
| 165 net::CertStatus cert_status; | 173 net::CertStatus cert_status; |
| 166 int connection_status; | 174 int connection_status; |
| 167 // The ID of the (EC)DH group used by the key exchange. The value is zero if | 175 // The ID of the (EC)DH group used by the key exchange. The value is zero if |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 211 |
| 204 private: | 212 private: |
| 205 SecurityStateModelClient* client_; | 213 SecurityStateModelClient* client_; |
| 206 | 214 |
| 207 DISALLOW_COPY_AND_ASSIGN(SecurityStateModel); | 215 DISALLOW_COPY_AND_ASSIGN(SecurityStateModel); |
| 208 }; | 216 }; |
| 209 | 217 |
| 210 } // namespace security_state | 218 } // namespace security_state |
| 211 | 219 |
| 212 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ | 220 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ |
| OLD | NEW |