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

Unified Diff: components/autofill/core/browser/autofill_manager.cc

Issue 2473493002: [Autofill] Credit card signin promo: do not require a local suggestion first. (Closed)
Patch Set: added test Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 6896ed6017b93dc4bfb4e9388625db8ddb731bfb..d64eca98160b3547488c0c832da922fba7f6af98 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -606,9 +606,11 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
// If there are no Autofill suggestions, consider showing Autocomplete
// suggestions. We will not show Autocomplete suggestions for a field that
- // specifies autocomplete=off (or an unrecognized type) or a field that we
- // think is a credit card expiration, cvc or number.
- if (suggestions.empty() && field.should_autocomplete &&
+ // specifies autocomplete=off (or an unrecognized type), a field for which we
+ // will show the credit card signin promo, or a field that we think is a
+ // credit card expiration, cvc or number.
+ if (suggestions.empty() && !ShouldShowCreditCardSigninPromo(form, field) &&
+ field.should_autocomplete &&
!(autofill_field &&
(IsCreditCardExpirationType(autofill_field->Type().GetStorableType()) ||
autofill_field->Type().html_type() == HTML_TYPE_UNRECOGNIZED ||

Powered by Google App Engine
This is Rietveld 408576698