[Merge M49][Autofill] Remove warning for CC autofill on secure pages with mixed passive content
Test page: https://420fb7a0cffed907f3562bad84d357ad43f54dbd.googledrive.com/host/0B3xzZ-vFr2LRWVFBaWl2V0M4NFk
BUG=574839
TEST=manual
Review URL: https://codereview.chromium.org/1659463003
Cr-Commit-Position: refs/heads/master@{#372784}
(cherry picked from commit af4d5da88d32e36044079a49f1af46e7d28fff70)
Review URL: https://codereview.chromium.org/1649293004 .
Cr-Commit-Position: refs/branch-heads/2623@{#229}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
diff --git a/android_webview/native/aw_autofill_client.cc b/android_webview/native/aw_autofill_client.cc
index b72eb14..cb7b6463 100644
--- a/android_webview/native/aw_autofill_client.cc
+++ b/android_webview/native/aw_autofill_client.cc
@@ -192,9 +192,9 @@
// Note: The implementation below is a copy of the one in
// ChromeAutofillClient::IsContextSecure, and should be kept in sync
// until crbug.com/505388 gets implemented.
- return ssl_status.security_style ==
- content::SECURITY_STYLE_AUTHENTICATED &&
- ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
+ return ssl_status.security_style == content::SECURITY_STYLE_AUTHENTICATED &&
+ !(ssl_status.content_status &
+ content::SSLStatus::RAN_INSECURE_CONTENT);
}
void AwAutofillClient::SuggestionSelected(JNIEnv* env,
diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc
index 437886c..5498824 100644
--- a/chrome/browser/ui/autofill/chrome_autofill_client.cc
+++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc
@@ -384,9 +384,9 @@
ssl_status = navigation_entry->GetSSL();
// Note: If changing the implementation below, also change
// AwAutofillClient::IsContextSecure. See crbug.com/505388
- return ssl_status.security_style ==
- content::SECURITY_STYLE_AUTHENTICATED &&
- ssl_status.content_status == content::SSLStatus::NORMAL_CONTENT;
+ return ssl_status.security_style == content::SECURITY_STYLE_AUTHENTICATED &&
+ !(ssl_status.content_status &
+ content::SSLStatus::RAN_INSECURE_CONTENT);
}
} // namespace autofill
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index f13bcc3..4c346f6 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -427,9 +427,9 @@
GetProfileSuggestions(*form_structure, field, *autofill_field);
}
if (!suggestions.empty()) {
- // Don't provide credit card suggestions for non-secure pages. However,
- // do provide a warning to the user. This will generate warnings on pages
- // with mixed content (which includes forms with an http target).
+ // Don't provide credit card suggestions for non-secure pages, but do
+ // provide them for secure pages with passive mixed content (see impl. of
+ // IsContextSecure).
if (is_filling_credit_card &&
!client_->IsContextSecure(form_structure->source_url())) {
Suggestion warning_suggestion(l10n_util::GetStringUTF16(