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

Unified Diff: chrome/browser/autofill/form_field.cc

Issue 11415221: Add support for autofilling radio buttons and checkboxes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix for android CQ failure. Created 8 years 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 | « chrome/browser/autofill/field_types.h ('k') | chrome/browser/autofill/form_field_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/form_field.cc
diff --git a/chrome/browser/autofill/form_field.cc b/chrome/browser/autofill/form_field.cc
index b8f941bbace5e5027199d471979a97d707da5a15..9d7e8f196572b0899709645b7ca55e4ac6ecd876 100644
--- a/chrome/browser/autofill/form_field.cc
+++ b/chrome/browser/autofill/form_field.cc
@@ -45,6 +45,10 @@ bool IsSelectField(const std::string& type) {
return type == "select-one";
}
+bool IsCheckable(const AutofillField* field) {
+ return field->is_checkable;
+}
+
} // namespace
// static
@@ -54,6 +58,13 @@ void FormField::ParseFormFields(const std::vector<AutofillField*>& fields,
std::vector<const AutofillField*> remaining_fields(fields.size());
std::copy(fields.begin(), fields.end(), remaining_fields.begin());
+ // Ignore checkable fields as they interfere with parsers assuming context.
+ // Eg., while parsing address, "Is PO box" checkbox after ADDRESS_LINE1
+ // interferes with correctly understanding ADDRESS_LINE2.
+ remaining_fields.erase(
+ std::remove_if(remaining_fields.begin(), remaining_fields.end(),
+ IsCheckable), remaining_fields.end());
Ilya Sherman 2012/12/18 04:32:40 nit: Please move the "remaining_fields.end()" argu
Raman Kakilate 2012/12/18 04:37:32 Done.
+
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
bool parse_new_field_types =
command_line.HasSwitch(switches::kEnableNewAutofillHeuristics);
« no previous file with comments | « chrome/browser/autofill/field_types.h ('k') | chrome/browser/autofill/form_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698