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_H_ | 5 #ifndef COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ |
6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ | 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/feature_list.h" |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "net/cert/cert_status_flags.h" | 14 #include "net/cert/cert_status_flags.h" |
14 #include "net/cert/sct_status_flags.h" | 15 #include "net/cert/sct_status_flags.h" |
15 #include "net/cert/x509_certificate.h" | 16 #include "net/cert/x509_certificate.h" |
16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
17 | 18 |
18 // Provides helper methods and data types that are used to determine the | 19 // Provides helper methods and data types that are used to determine the |
19 // high-level security information about a page or request. | 20 // high-level security information about a page or request. |
20 // | 21 // |
21 // SecurityInfo is the main data structure, describing a page's or request's | 22 // SecurityInfo is the main data structure, describing a page's or request's |
22 // security state. It is computed by the platform-independent GetSecurityInfo() | 23 // security state. It is computed by the platform-independent GetSecurityInfo() |
23 // helper method, which receives platform-specific inputs from its callers in | 24 // helper method, which receives platform-specific inputs from its callers in |
24 // the form of a VisibleSecurityState struct. | 25 // the form of a VisibleSecurityState struct. |
25 namespace security_state { | 26 namespace security_state { |
26 | 27 |
| 28 // A feature for showing a warning in autofill dropdowns for password |
| 29 // and credit cards fields when the top-level page is not HTTPS. |
| 30 extern const base::Feature kHttpFormWarningFeature; |
| 31 |
27 // Describes the overall security state of the page. | 32 // Describes the overall security state of the page. |
28 // | 33 // |
29 // If you reorder, add, or delete values from this enum, you must also | 34 // If you reorder, add, or delete values from this enum, you must also |
30 // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel. | 35 // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel. |
31 // | 36 // |
32 // A Java counterpart will be generated for this enum. | 37 // A Java counterpart will be generated for this enum. |
33 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.security_state | 38 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.security_state |
34 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityLevel | 39 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityLevel |
35 enum SecurityLevel { | 40 enum SecurityLevel { |
36 // HTTP/no URL/HTTPS but with insecure passive content on the page. | 41 // HTTP/no URL/HTTPS but with insecure passive content on the page. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // |used_policy_installed_certificate| indicates whether the page or request | 214 // |used_policy_installed_certificate| indicates whether the page or request |
210 // is known to be loaded with a certificate installed by the system admin. | 215 // is known to be loaded with a certificate installed by the system admin. |
211 // |is_origin_secure_callback| determines whether a URL's origin should be | 216 // |is_origin_secure_callback| determines whether a URL's origin should be |
212 // considered secure. | 217 // considered secure. |
213 void GetSecurityInfo( | 218 void GetSecurityInfo( |
214 std::unique_ptr<VisibleSecurityState> visible_security_state, | 219 std::unique_ptr<VisibleSecurityState> visible_security_state, |
215 bool used_policy_installed_certificate, | 220 bool used_policy_installed_certificate, |
216 IsOriginSecureCallback is_origin_secure_callback, | 221 IsOriginSecureCallback is_origin_secure_callback, |
217 SecurityInfo* result); | 222 SecurityInfo* result); |
218 | 223 |
| 224 // Returns true if an experimental form warning UI about HTTP passwords |
| 225 // and credit cards is enabled. This warning UI can be enabled with the |
| 226 // |kHttpFormWarningFeature| feature. |
| 227 bool IsHttpWarningInFormEnabled(); |
| 228 |
219 } // namespace security_state | 229 } // namespace security_state |
220 | 230 |
221 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ | 231 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ |
OLD | NEW |