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

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

Issue 2635423002: Enable HTTP-bad Phase 1 by default except iOS (Closed)
Patch Set: fixes Created 3 years, 11 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 #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"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 SecurityLevel level = NONE; 67 SecurityLevel level = NONE;
68 MarkHttpStatus status; 68 MarkHttpStatus status;
69 69
70 // If the command-line switch is set, then it takes precedence over 70 // If the command-line switch is set, then it takes precedence over
71 // the field trial group. 71 // the field trial group.
72 if (!GetSecurityLevelAndHistogramValueForNonSecureFieldTrial( 72 if (!GetSecurityLevelAndHistogramValueForNonSecureFieldTrial(
73 choice, displayed_sensitive_input_on_http, &level, &status)) { 73 choice, displayed_sensitive_input_on_http, &level, &status)) {
74 if (!GetSecurityLevelAndHistogramValueForNonSecureFieldTrial( 74 if (!GetSecurityLevelAndHistogramValueForNonSecureFieldTrial(
75 group, displayed_sensitive_input_on_http, &level, &status)) { 75 group, displayed_sensitive_input_on_http, &level, &status)) {
76 // If neither the command-line switch nor field trial group is set, then 76 // If neither the command-line switch nor field trial group is set, then
77 // nonsecure defaults to neutral. 77 // nonsecure defaults to neutral for iOS and HTTP_SHOW_WARNING on other
78 // platforms.
79 #if defined(OS_IOS)
78 status = NEUTRAL; 80 status = NEUTRAL;
79 level = NONE; 81 level = NONE;
82 #else
83 status = HTTP_SHOW_WARNING;
84 level = displayed_sensitive_input_on_http
85 ? security_state::HTTP_SHOW_WARNING
86 : NONE;
87 #endif
80 } 88 }
81 } 89 }
82 90
83 UMA_HISTOGRAM_ENUMERATION(kEnumeration, status, LAST_STATUS); 91 UMA_HISTOGRAM_ENUMERATION(kEnumeration, status, LAST_STATUS);
84 return level; 92 return level;
85 } 93 }
86 94
87 ContentStatus GetContentStatus(bool displayed, bool ran) { 95 ContentStatus GetContentStatus(bool displayed, bool ran) {
88 if (ran && displayed) 96 if (ran && displayed)
89 return CONTENT_STATUS_DISPLAYED_AND_RAN; 97 return CONTENT_STATUS_DISPLAYED_AND_RAN;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 other.displayed_content_with_cert_errors && 311 other.displayed_content_with_cert_errors &&
304 ran_content_with_cert_errors == other.ran_content_with_cert_errors && 312 ran_content_with_cert_errors == other.ran_content_with_cert_errors &&
305 pkp_bypassed == other.pkp_bypassed && 313 pkp_bypassed == other.pkp_bypassed &&
306 displayed_password_field_on_http == 314 displayed_password_field_on_http ==
307 other.displayed_password_field_on_http && 315 other.displayed_password_field_on_http &&
308 displayed_credit_card_field_on_http == 316 displayed_credit_card_field_on_http ==
309 other.displayed_credit_card_field_on_http); 317 other.displayed_credit_card_field_on_http);
310 } 318 }
311 319
312 } // namespace security_state 320 } // namespace security_state
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698