Chromium Code Reviews| 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 e3c5e3c66c9fc84f24197da1106f06db992fd77a..3750c2c56460e1f8598de28bc256530ae7de128c 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 false. |
|
Mathieu
2015/11/27 16:14:33
false -> off
sebsg
2015/11/27 19:26:21
Done.
|
| + if (IsOnDesktop() && !is_filling_credit_card && |
| + !field.should_autocomplete) { |
| + return; |
| + } |
| if (is_filling_credit_card) { |
| suggestions = GetCreditCardSuggestions(field, type); |
| } else { |