| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1341 | 1341 |
| 1342 if (security_info.sha1_deprecation_status == | 1342 if (security_info.sha1_deprecation_status == |
| 1343 SecurityStateModel::DEPRECATED_SHA1_MAJOR) { | 1343 SecurityStateModel::DEPRECATED_SHA1_MAJOR) { |
| 1344 security_style_explanations->broken_explanations.push_back( | 1344 security_style_explanations->broken_explanations.push_back( |
| 1345 content::SecurityStyleExplanation( | 1345 content::SecurityStyleExplanation( |
| 1346 l10n_util::GetStringUTF8(IDS_MAJOR_SHA1), | 1346 l10n_util::GetStringUTF8(IDS_MAJOR_SHA1), |
| 1347 l10n_util::GetStringUTF8(IDS_MAJOR_SHA1_DESCRIPTION), | 1347 l10n_util::GetStringUTF8(IDS_MAJOR_SHA1_DESCRIPTION), |
| 1348 security_info.cert_id)); | 1348 security_info.cert_id)); |
| 1349 } else if (security_info.sha1_deprecation_status == | 1349 } else if (security_info.sha1_deprecation_status == |
| 1350 SecurityStateModel::DEPRECATED_SHA1_MINOR) { | 1350 SecurityStateModel::DEPRECATED_SHA1_MINOR) { |
| 1351 security_style_explanations->warning_explanations.push_back( | 1351 security_style_explanations->unauthenticated_explanations.push_back( |
| 1352 content::SecurityStyleExplanation( | 1352 content::SecurityStyleExplanation( |
| 1353 l10n_util::GetStringUTF8(IDS_MINOR_SHA1), | 1353 l10n_util::GetStringUTF8(IDS_MINOR_SHA1), |
| 1354 l10n_util::GetStringUTF8(IDS_MINOR_SHA1_DESCRIPTION), | 1354 l10n_util::GetStringUTF8(IDS_MINOR_SHA1_DESCRIPTION), |
| 1355 security_info.cert_id)); | 1355 security_info.cert_id)); |
| 1356 } | 1356 } |
| 1357 | 1357 |
| 1358 security_style_explanations->ran_insecure_content = | 1358 security_style_explanations->ran_insecure_content = |
| 1359 security_info.mixed_content_status == | 1359 security_info.mixed_content_status == |
| 1360 SecurityStateModel::RAN_MIXED_CONTENT || | 1360 SecurityStateModel::RAN_MIXED_CONTENT || |
| 1361 security_info.mixed_content_status == | 1361 security_info.mixed_content_status == |
| 1362 SecurityStateModel::RAN_AND_DISPLAYED_MIXED_CONTENT; | 1362 SecurityStateModel::RAN_AND_DISPLAYED_MIXED_CONTENT; |
| 1363 security_style_explanations->displayed_insecure_content = | 1363 security_style_explanations->displayed_insecure_content = |
| 1364 security_info.mixed_content_status == | 1364 security_info.mixed_content_status == |
| 1365 SecurityStateModel::DISPLAYED_MIXED_CONTENT || | 1365 SecurityStateModel::DISPLAYED_MIXED_CONTENT || |
| 1366 security_info.mixed_content_status == | 1366 security_info.mixed_content_status == |
| 1367 SecurityStateModel::RAN_AND_DISPLAYED_MIXED_CONTENT; | 1367 SecurityStateModel::RAN_AND_DISPLAYED_MIXED_CONTENT; |
| 1368 | 1368 |
| 1369 if (net::IsCertStatusError(security_info.cert_status)) { | 1369 if (net::IsCertStatusError(security_info.cert_status)) { |
| 1370 base::string16 error_string = base::UTF8ToUTF16(net::ErrorToString( | 1370 base::string16 error_string = base::UTF8ToUTF16(net::ErrorToString( |
| 1371 net::MapCertStatusToNetError(security_info.cert_status))); | 1371 net::MapCertStatusToNetError(security_info.cert_status))); |
| 1372 | 1372 |
| 1373 content::SecurityStyleExplanation explanation( | 1373 content::SecurityStyleExplanation explanation( |
| 1374 l10n_util::GetStringUTF8(IDS_CERTIFICATE_CHAIN_ERROR), | 1374 l10n_util::GetStringUTF8(IDS_CERTIFICATE_CHAIN_ERROR), |
| 1375 l10n_util::GetStringFUTF8( | 1375 l10n_util::GetStringFUTF8( |
| 1376 IDS_CERTIFICATE_CHAIN_ERROR_DESCRIPTION_FORMAT, error_string), | 1376 IDS_CERTIFICATE_CHAIN_ERROR_DESCRIPTION_FORMAT, error_string), |
| 1377 security_info.cert_id); | 1377 security_info.cert_id); |
| 1378 | 1378 |
| 1379 if (net::IsCertStatusMinorError(security_info.cert_status)) | 1379 if (net::IsCertStatusMinorError(security_info.cert_status)) |
| 1380 security_style_explanations->warning_explanations.push_back(explanation); | 1380 security_style_explanations->unauthenticated_explanations.push_back( |
| 1381 explanation); |
| 1381 else | 1382 else |
| 1382 security_style_explanations->broken_explanations.push_back(explanation); | 1383 security_style_explanations->broken_explanations.push_back(explanation); |
| 1383 } else { | 1384 } else { |
| 1384 // If the certificate does not have errors and is not using | 1385 // If the certificate does not have errors and is not using |
| 1385 // deprecated SHA1, then add an explanation that the certificate is | 1386 // deprecated SHA1, then add an explanation that the certificate is |
| 1386 // valid. | 1387 // valid. |
| 1387 if (security_info.sha1_deprecation_status == | 1388 if (security_info.sha1_deprecation_status == |
| 1388 SecurityStateModel::NO_DEPRECATED_SHA1) { | 1389 SecurityStateModel::NO_DEPRECATED_SHA1) { |
| 1389 security_style_explanations->secure_explanations.push_back( | 1390 security_style_explanations->secure_explanations.push_back( |
| 1390 content::SecurityStyleExplanation( | 1391 content::SecurityStyleExplanation( |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2703 if (contents && !allow_js_access) { | 2704 if (contents && !allow_js_access) { |
| 2704 contents->web_contents()->GetController().LoadURL( | 2705 contents->web_contents()->GetController().LoadURL( |
| 2705 target_url, | 2706 target_url, |
| 2706 content::Referrer(), | 2707 content::Referrer(), |
| 2707 ui::PAGE_TRANSITION_LINK, | 2708 ui::PAGE_TRANSITION_LINK, |
| 2708 std::string()); // No extra headers. | 2709 std::string()); // No extra headers. |
| 2709 } | 2710 } |
| 2710 | 2711 |
| 2711 return contents != NULL; | 2712 return contents != NULL; |
| 2712 } | 2713 } |
| OLD | NEW |