Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: components/security_state/core/security_state.h

Issue 2917873004: Implement 'Not secure' warning for non-secure pages in Incognito mode (Closed)
Patch Set: Remove obsolete includes Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_CORE_SECURITY_STATE_H_
6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ 6 #define COMPONENTS_SECURITY_STATE_CORE_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/feature_list.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "net/cert/cert_status_flags.h" 14 #include "net/cert/cert_status_flags.h"
15 #include "net/cert/sct_status_flags.h" 15 #include "net/cert/sct_status_flags.h"
16 #include "net/cert/x509_certificate.h" 16 #include "net/cert/x509_certificate.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool pkp_bypassed; 134 bool pkp_bypassed;
135 // True if the page displayed password field on an HTTP page. 135 // True if the page displayed password field on an HTTP page.
136 bool displayed_password_field_on_http; 136 bool displayed_password_field_on_http;
137 // True if the page displayed credit card field on an HTTP page. 137 // True if the page displayed credit card field on an HTTP page.
138 bool displayed_credit_card_field_on_http; 138 bool displayed_credit_card_field_on_http;
139 // True if the secure page contained a form with a nonsecure target. 139 // True if the secure page contained a form with a nonsecure target.
140 bool contained_mixed_form; 140 bool contained_mixed_form;
141 // True if the server's certificate does not contain a 141 // True if the server's certificate does not contain a
142 // subjectAltName extension with a domain name or IP address. 142 // subjectAltName extension with a domain name or IP address.
143 bool cert_missing_subject_alt_name; 143 bool cert_missing_subject_alt_name;
144 // True if the |security_level| was downgraded to HTTP_SHOW_WARNING because
145 // the page was loaded while Incognito.
146 bool incognito_downgraded_security_level;
144 }; 147 };
145 148
146 // Contains the security state relevant to computing the SecurityInfo 149 // Contains the security state relevant to computing the SecurityInfo
147 // for a page. This is the input to GetSecurityInfo(). 150 // for a page. This is the input to GetSecurityInfo().
148 struct VisibleSecurityState { 151 struct VisibleSecurityState {
149 VisibleSecurityState(); 152 VisibleSecurityState();
150 ~VisibleSecurityState(); 153 ~VisibleSecurityState();
151 bool operator==(const VisibleSecurityState& other) const; 154 bool operator==(const VisibleSecurityState& other) const;
152 GURL url; 155 GURL url;
153 156
(...skipping 20 matching lines...) Expand all
174 // True if the page displayed passive subresources with certificate errors. 177 // True if the page displayed passive subresources with certificate errors.
175 bool displayed_content_with_cert_errors; 178 bool displayed_content_with_cert_errors;
176 // True if the page ran active subresources with certificate errors. 179 // True if the page ran active subresources with certificate errors.
177 bool ran_content_with_cert_errors; 180 bool ran_content_with_cert_errors;
178 // True if PKP was bypassed due to a local trust anchor. 181 // True if PKP was bypassed due to a local trust anchor.
179 bool pkp_bypassed; 182 bool pkp_bypassed;
180 // True if the page was an HTTP page that displayed a password field. 183 // True if the page was an HTTP page that displayed a password field.
181 bool displayed_password_field_on_http; 184 bool displayed_password_field_on_http;
182 // True if the page was an HTTP page that displayed a credit card field. 185 // True if the page was an HTTP page that displayed a credit card field.
183 bool displayed_credit_card_field_on_http; 186 bool displayed_credit_card_field_on_http;
187 // True if the page was displayed in an Incognito context.
188 bool is_incognito;
184 }; 189 };
185 190
186 // These security levels describe the treatment given to pages that 191 // These security levels describe the treatment given to pages that
187 // display and run mixed content. They are used to coordinate the 192 // display and run mixed content. They are used to coordinate the
188 // treatment of mixed content with other security UI elements. 193 // treatment of mixed content with other security UI elements.
189 constexpr SecurityLevel kDisplayedInsecureContentLevel = NONE; 194 constexpr SecurityLevel kDisplayedInsecureContentLevel = NONE;
190 constexpr SecurityLevel kRanInsecureContentLevel = DANGEROUS; 195 constexpr SecurityLevel kRanInsecureContentLevel = DANGEROUS;
191 196
192 // Returns true if the given |url|'s origin should be considered secure. 197 // Returns true if the given |url|'s origin should be considered secure.
193 using IsOriginSecureCallback = base::Callback<bool(const GURL& url)>; 198 using IsOriginSecureCallback = base::Callback<bool(const GURL& url)>;
194 199
195 // Populates |result| to describe the current page. 200 // Populates |result| to describe the current page.
196 // |visible_security_state| contains the relevant security state. 201 // |visible_security_state| contains the relevant security state.
197 // |used_policy_installed_certificate| indicates whether the page or request 202 // |used_policy_installed_certificate| indicates whether the page or request
198 // is known to be loaded with a certificate installed by the system admin. 203 // is known to be loaded with a certificate installed by the system admin.
199 // |is_origin_secure_callback| determines whether a URL's origin should be 204 // |is_origin_secure_callback| determines whether a URL's origin should be
200 // considered secure. 205 // considered secure.
201 void GetSecurityInfo( 206 void GetSecurityInfo(
202 std::unique_ptr<VisibleSecurityState> visible_security_state, 207 std::unique_ptr<VisibleSecurityState> visible_security_state,
203 bool used_policy_installed_certificate, 208 bool used_policy_installed_certificate,
204 IsOriginSecureCallback is_origin_secure_callback, 209 IsOriginSecureCallback is_origin_secure_callback,
205 SecurityInfo* result); 210 SecurityInfo* result);
206 211
207 // Returns true if an experimental form warning UI about HTTP passwords 212 // Returns true if an experimental form warning UI about HTTP passwords
208 // and credit cards is enabled. This warning UI can be enabled with the 213 // and credit cards is enabled. This warning UI can be enabled with the
209 // |kHttpFormWarningFeature| feature. 214 // |kHttpFormWarningFeature| feature.
210 bool IsHttpWarningInFormEnabled(); 215 bool IsHttpWarningInFormEnabled();
211 216
217 // Returns true if the MarkHttpAs setting indicates that a warning
218 // should be shown for HTTP pages loaded while in Incognito mode.
219 bool IsHttpWarningForIncognitoEnabled();
220
212 } // namespace security_state 221 } // namespace security_state
213 222
214 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_H_ 223 #endif // COMPONENTS_SECURITY_STATE_CORE_SECURITY_STATE_H_
OLDNEW
« no previous file with comments | « components/security_state/content/content_utils_unittest.cc ('k') | components/security_state/core/security_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698