Chromium Code Reviews| 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 "chrome/browser/ssl/chrome_security_state_model_client.h" | 5 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| 6 | 6 |
| 7 #include <openssl/ssl.h> | 7 #include <openssl/ssl.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 | 177 |
| 178 ChromeSecurityStateModelClient::~ChromeSecurityStateModelClient() {} | 178 ChromeSecurityStateModelClient::~ChromeSecurityStateModelClient() {} |
| 179 | 179 |
| 180 // static | 180 // static |
| 181 blink::WebSecurityStyle ChromeSecurityStateModelClient::GetSecurityStyle( | 181 blink::WebSecurityStyle ChromeSecurityStateModelClient::GetSecurityStyle( |
| 182 const security_state::SecurityStateModel::SecurityInfo& security_info, | 182 const security_state::SecurityStateModel::SecurityInfo& security_info, |
| 183 content::SecurityStyleExplanations* security_style_explanations) { | 183 content::SecurityStyleExplanations* security_style_explanations) { |
| 184 const blink::WebSecurityStyle security_style = | 184 const blink::WebSecurityStyle security_style = |
| 185 SecurityLevelToSecurityStyle(security_info.security_level); | 185 SecurityLevelToSecurityStyle(security_info.security_level); |
| 186 | 186 |
| 187 if (security_info.security_level == | |
| 188 security_state::SecurityStateModel::HTTP_SHOW_WARNING) { | |
| 189 security_style_explanations->unauthenticated_explanations.push_back( | |
|
lgarron
2016/10/18 23:49:55
I *think* this should be an info explanation?
| |
| 190 content::SecurityStyleExplanation( | |
| 191 l10n_util::GetStringUTF8(IDS_PRIVATE_USER_DATA_INPUT), | |
| 192 l10n_util::GetStringUTF8(IDS_PRIVATE_USER_DATA_INPUT_DESCRIPTION))); | |
| 193 } | |
| 194 | |
| 187 security_style_explanations->ran_insecure_content_style = | 195 security_style_explanations->ran_insecure_content_style = |
| 188 SecurityLevelToSecurityStyle( | 196 SecurityLevelToSecurityStyle( |
| 189 SecurityStateModel::kRanInsecureContentLevel); | 197 SecurityStateModel::kRanInsecureContentLevel); |
| 190 security_style_explanations->displayed_insecure_content_style = | 198 security_style_explanations->displayed_insecure_content_style = |
| 191 SecurityLevelToSecurityStyle( | 199 SecurityLevelToSecurityStyle( |
| 192 SecurityStateModel::kDisplayedInsecureContentLevel); | 200 SecurityStateModel::kDisplayedInsecureContentLevel); |
| 193 | 201 |
| 194 // Check if the page is HTTP; if so, no explanations are needed. Note | 202 // Check if the page is HTTP; if so, no more explanations are needed. Note |
| 195 // that SecurityStyleUnauthenticated does not necessarily mean that | 203 // that SecurityStyleUnauthenticated does not necessarily mean that |
| 196 // the page is loaded over HTTP, because the security style merely | 204 // the page is loaded over HTTP, because the security style merely |
| 197 // represents how the embedder wishes to display the security state of | 205 // represents how the embedder wishes to display the security state of |
| 198 // the page, and the embedder can choose to display HTTPS page as HTTP | 206 // the page, and the embedder can choose to display HTTPS page as HTTP |
| 199 // if it wants to (for example, displaying deprecated crypto | 207 // if it wants to (for example, displaying deprecated crypto |
| 200 // algorithms with the same UI treatment as HTTP pages). | 208 // algorithms with the same UI treatment as HTTP pages). |
| 201 security_style_explanations->scheme_is_cryptographic = | 209 security_style_explanations->scheme_is_cryptographic = |
| 202 security_info.scheme_is_cryptographic; | 210 security_info.scheme_is_cryptographic; |
| 203 if (!security_info.scheme_is_cryptographic) { | 211 if (!security_info.scheme_is_cryptographic) { |
| 204 return security_style; | 212 return security_style; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 !!(ssl.content_status & content::SSLStatus::RAN_CONTENT_WITH_CERT_ERRORS); | 397 !!(ssl.content_status & content::SSLStatus::RAN_CONTENT_WITH_CERT_ERRORS); |
| 390 state->displayed_password_field_on_http = | 398 state->displayed_password_field_on_http = |
| 391 !!(ssl.content_status & | 399 !!(ssl.content_status & |
| 392 content::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP); | 400 content::SSLStatus::DISPLAYED_PASSWORD_FIELD_ON_HTTP); |
| 393 state->displayed_credit_card_field_on_http = | 401 state->displayed_credit_card_field_on_http = |
| 394 !!(ssl.content_status & | 402 !!(ssl.content_status & |
| 395 content::SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP); | 403 content::SSLStatus::DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP); |
| 396 | 404 |
| 397 CheckSafeBrowsingStatus(entry, web_contents_, state); | 405 CheckSafeBrowsingStatus(entry, web_contents_, state); |
| 398 } | 406 } |
| OLD | NEW |