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

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

Issue 934863003: Autofill: Fix showing predictions for synthetic forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 10 months 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
« no previous file with comments | « components/autofill/core/browser/form_structure.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/form_structure.cc
diff --git a/components/autofill/core/browser/form_structure.cc b/components/autofill/core/browser/form_structure.cc
index c546a113f773d27526d2b39b799f41197ab6a5cc..e0ed585ff8b97ab990dde72dcf69c3f015970674 100644
--- a/components/autofill/core/browser/form_structure.cc
+++ b/components/autofill/core/browser/form_structure.cc
@@ -624,17 +624,17 @@ void FormStructure::ParseQueryResponse(
}
// static
-void FormStructure::GetFieldTypePredictions(
- const std::vector<FormStructure*>& form_structures,
- std::vector<FormDataPredictions>* forms) {
- forms->clear();
- forms->reserve(form_structures.size());
+std::vector<FormDataPredictions> FormStructure::GetFieldTypePredictions(
+ const std::vector<FormStructure*>& form_structures) {
+ std::vector<FormDataPredictions> forms;
+ forms.reserve(form_structures.size());
for (size_t i = 0; i < form_structures.size(); ++i) {
FormStructure* form_structure = form_structures[i];
FormDataPredictions form;
form.data.name = form_structure->form_name_;
form.data.origin = form_structure->source_url_;
form.data.action = form_structure->target_url_;
+ form.data.is_form_tag = form_structure->is_form_tag_;
form.signature = form_structure->FormSignature();
for (std::vector<AutofillField*>::const_iterator field =
@@ -652,8 +652,9 @@ void FormStructure::GetFieldTypePredictions(
form.fields.push_back(annotated_field);
}
- forms->push_back(form);
+ forms.push_back(form);
}
+ return forms;
}
std::string FormStructure::FormSignature() const {
« no previous file with comments | « components/autofill/core/browser/form_structure.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698