Index: components/autofill/core/browser/autofill_assistant.cc |
diff --git a/components/autofill/core/browser/autofill_assistant.cc b/components/autofill/core/browser/autofill_assistant.cc |
index 384eec6768980cf0aef433077b4bca8c97df24f4..4fccc2a7997e1d83349ee128191342f1a16befb6 100644 |
--- a/components/autofill/core/browser/autofill_assistant.cc |
+++ b/components/autofill/core/browser/autofill_assistant.cc |
@@ -29,9 +29,12 @@ bool AutofillAssistant::CanShowCreditCardAssist( |
const std::vector<std::unique_ptr<FormStructure>>& form_structures) { |
if (form_structures.empty() || credit_card_form_data_ != nullptr || |
!IsAutofillCreditCardAssistEnabled() || |
- !autofill_manager_->client()->IsContextSecure( |
- form_structures.front()->source_url()) || |
- !form_structures.front()->target_url().SchemeIs("https")) { |
+ // Context of the page is not secure or target URL is valid but not |
+ // secure. |
+ !(autofill_manager_->client()->IsContextSecure( |
+ form_structures.front()->source_url()) && |
+ (!form_structures.front()->target_url().is_valid() || |
+ !form_structures.front()->target_url().SchemeIs("http")))) { |
return false; |
} |