| Index: ios/chrome/browser/autofill/autofill_agent.mm
|
| diff --git a/ios/chrome/browser/autofill/autofill_agent.mm b/ios/chrome/browser/autofill/autofill_agent.mm
|
| index 1cdc17b4ab9dedc05037cd1e0efb2629e1d8240b..280132ca6cf3cd3f72d54cb8d02708499cec3436 100644
|
| --- a/ios/chrome/browser/autofill/autofill_agent.mm
|
| +++ b/ios/chrome/browser/autofill/autofill_agent.mm
|
| @@ -65,12 +65,14 @@ void GetFormAndField(autofill::FormData* form,
|
| const std::string& fieldName,
|
| const std::string& type) {
|
| DCHECK_GE(forms.size(), 1U);
|
| - *form = forms[0];
|
| const base::string16 fieldName16 = base::UTF8ToUTF16(fieldName);
|
| - for (const auto& currentField : form->fields) {
|
| - if (currentField.name == fieldName16) {
|
| - *field = currentField;
|
| - break;
|
| + for (const auto& currentForm : forms) {
|
| + for (const auto& currentField : currentForm.fields) {
|
| + if (currentField.name == fieldName16) {
|
| + *form = currentForm;
|
| + *field = currentField;
|
| + break;
|
| + }
|
| }
|
| }
|
| if (field->SameFieldAs(autofill::FormFieldData()))
|
| @@ -538,7 +540,7 @@ void GetFormAndField(autofill::FormData* form,
|
| // AutofillManager for suggestions.
|
| __weak AutofillAgent* weakSelf = self;
|
| id completionHandler = ^(BOOL success, const FormDataVector& forms) {
|
| - if (success && forms.size() == 1) {
|
| + if (success && forms.size() >= 1) {
|
| [weakSelf queryAutofillWithForms:forms
|
| field:fieldName
|
| type:type
|
| @@ -743,7 +745,7 @@ void GetFormAndField(autofill::FormData* form,
|
|
|
| __weak AutofillAgent* weakSelf = self;
|
| id completionHandler = ^(BOOL success, const FormDataVector& forms) {
|
| - if (success && forms.size() == 1) {
|
| + if (success && forms.size() >= 1) {
|
| [weakSelf processFormActivityExtractedData:forms
|
| fieldName:fieldNameCopy
|
| type:typeCopy
|
|
|