Chromium Code Reviews| Index: components/autofill/core/browser/autofill_external_delegate.cc |
| diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc |
| index 6b04aa5b5733fa0e876d9bb7fe52e030075ccd62..1f9a370a61316d27d723784583f419c17abe8c90 100644 |
| --- a/components/autofill/core/browser/autofill_external_delegate.cc |
| +++ b/components/autofill/core/browser/autofill_external_delegate.cc |
| @@ -301,10 +301,11 @@ void AutofillExternalDelegate::FillAutofillFormData(int unique_id, |
| void AutofillExternalDelegate::ApplyAutofillWarnings( |
|
Mathieu
2016/11/07 14:32:27
Let's change the name and documentation of this fu
lshang
2016/11/08 06:00:57
Done.
|
| std::vector<Suggestion>* suggestions) { |
| - if (suggestions->size() > 1 && |
| - (*suggestions)[0].frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE) { |
| - // If we received a warning instead of suggestions from Autofill but regular |
| - // suggestions from autocomplete, don't show the Autofill warning. |
| + while (suggestions->size() > 1 && |
|
Mathieu
2016/11/07 14:32:27
This works as long as POPUP_ITEM_ID_WARNING_MESSAG
lshang
2016/11/08 06:00:57
Done.
|
| + suggestions->front().frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE && |
| + suggestions->back().frontend_id != POPUP_ITEM_ID_WARNING_MESSAGE) { |
| + // If we received warnings instead of suggestions from Autofill but regular |
| + // suggestions from autocomplete, don't show the Autofill warnings. |
| suggestions->erase(suggestions->begin()); |
| } |
| } |