diff options
Diffstat (limited to 'components/autofill/core/browser/autofill_manager.cc')
-rw-r--r-- | components/autofill/core/browser/autofill_manager.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index e3c5e3c..dca717d 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc @@ -49,6 +49,7 @@ #include "components/autofill/core/common/autofill_data_validation.h" #include "components/autofill/core/common/autofill_pref_names.h" #include "components/autofill/core/common/autofill_switches.h" +#include "components/autofill/core/common/autofill_util.h" #include "components/autofill/core/common/form_data.h" #include "components/autofill/core/common/form_data_predictions.h" #include "components/autofill/core/common/form_field_data.h" @@ -407,6 +408,12 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id, got_autofillable_form) { AutofillType type = autofill_field->Type(); bool is_filling_credit_card = (type.group() == CREDIT_CARD); + // On desktop, don't return non credit card related suggestions for forms or + // fields that have the "autocomplete" attribute set to off. + if (IsDesktopPlatform() && !is_filling_credit_card && + !field.should_autocomplete) { + return; + } if (is_filling_credit_card) { suggestions = GetCreditCardSuggestions(field, type); } else { |