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 #include "components/security_state/core/security_state.h" | 5 #include "components/security_state/core/security_state.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "components/security_state/core/switches.h" | 12 #include "components/security_state/core/switches.h" |
13 #include "net/ssl/ssl_cipher_suite_names.h" | 13 #include "net/ssl/ssl_cipher_suite_names.h" |
14 #include "net/ssl/ssl_connection_status_flags.h" | 14 #include "net/ssl/ssl_connection_status_flags.h" |
15 | 15 |
16 namespace security_state { | 16 namespace security_state { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Do not change or reorder this enum, and add new values at the end. It is used | 20 // These values are written to logs. New enum values can be added, but existing |
elawrence
2017/05/30 20:18:14
Updated comment and made numbering explicit per ht
estark
2017/05/30 22:46:42
Thanks!
| |
21 // in the MarkHttpAs histogram. | 21 // enums must never be renumbered or deleted and reused. |
22 enum MarkHttpStatus { | 22 enum MarkHttpStatus { |
23 NEUTRAL /* deprecated */, | 23 NEUTRAL = 0, // Deprecated |
24 NON_SECURE, | 24 NON_SECURE = 1, |
25 HTTP_SHOW_WARNING_ON_SENSITIVE_FIELDS, | 25 HTTP_SHOW_WARNING_ON_SENSITIVE_FIELDS = 2, |
26 NON_SECURE_WHILE_EDITING = 3, | |
27 NON_SECURE_WHILE_INCOGNITO = 4, | |
28 NON_SECURE_WHILE_INCOGNITO_OR_EDITING = 5, | |
26 LAST_STATUS | 29 LAST_STATUS |
27 }; | 30 }; |
28 | 31 |
29 // If |switch_or_field_trial_group| corresponds to a valid | 32 // If |switch_or_field_trial_group| corresponds to a valid |
30 // MarkHttpAs group, sets |*level| and |*histogram_status| to the | 33 // MarkHttpAs group, sets |*level| and |*histogram_status| to the |
31 // appropriate values and returns true. Otherwise, returns false. | 34 // appropriate values and returns true. Otherwise, returns false. |
32 bool GetSecurityLevelAndHistogramValueForNonSecureFieldTrial( | 35 bool GetSecurityLevelAndHistogramValueForNonSecureFieldTrial( |
33 std::string switch_or_field_trial_group, | 36 std::string switch_or_field_trial_group, |
34 bool displayed_sensitive_input_on_http, | 37 bool displayed_sensitive_input_on_http, |
35 SecurityLevel* level, | 38 SecurityLevel* level, |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
309 ran_content_with_cert_errors == other.ran_content_with_cert_errors && | 312 ran_content_with_cert_errors == other.ran_content_with_cert_errors && |
310 pkp_bypassed == other.pkp_bypassed && | 313 pkp_bypassed == other.pkp_bypassed && |
311 displayed_password_field_on_http == | 314 displayed_password_field_on_http == |
312 other.displayed_password_field_on_http && | 315 other.displayed_password_field_on_http && |
313 displayed_credit_card_field_on_http == | 316 displayed_credit_card_field_on_http == |
314 other.displayed_credit_card_field_on_http && | 317 other.displayed_credit_card_field_on_http && |
315 contained_mixed_form == other.contained_mixed_form); | 318 contained_mixed_form == other.contained_mixed_form); |
316 } | 319 } |
317 | 320 |
318 } // namespace security_state | 321 } // namespace security_state |
OLD | NEW |