summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/form_structure.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-27 02:19:15 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-27 02:19:15 +0000
commit8ea2025aafbad247dd50cd19a81a364c14fc5796 (patch)
treeeefb409eea12f709a4a20055b3ba5dcaa74407a0 /chrome/browser/autofill/form_structure.cc
parentd58b6b41902228daeacacd1c42ce15469c18d4be (diff)
downloadchromium_src-8ea2025aafbad247dd50cd19a81a364c14fc5796.zip
chromium_src-8ea2025aafbad247dd50cd19a81a364c14fc5796.tar.gz
chromium_src-8ea2025aafbad247dd50cd19a81a364c14fc5796.tar.bz2
AutoFill: Handle filling select controls.
BUG=38222 TEST=none Review URL: http://codereview.chromium.org/1309003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42891 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/form_structure.cc')
-rw-r--r--chrome/browser/autofill/form_structure.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc
index dd9cfaa..8628036 100644
--- a/chrome/browser/autofill/form_structure.cc
+++ b/chrome/browser/autofill/form_structure.cc
@@ -34,7 +34,8 @@ const char* const kXMLElementForm = "form";
const char* const kXMLElementField = "field";
const char* const kAttributeAutoFillType = "autofilltype";
-// The only form control type we handle currently.
+// The list of form control types we handle.
+const char* const kControlTypeSelect = "select-one";
const char* const kControlTypeText = "text";
// The number of fillable fields necessary for a form to be fillable.
@@ -66,9 +67,11 @@ FormStructure::FormStructure(const FormFieldValues& values)
std::vector<webkit_glue::FormField>::const_iterator field;
for (field = values.elements.begin();
field != values.elements.end(); field++) {
- // We currently only handle text fields. This prevents us from thinking we
- // can autofill other types of controls, e.g., select, password, hidden.
- if (!LowerCaseEqualsASCII(field->form_control_type(), kControlTypeText))
+ // We currently only handle text and seleect fields. This prevents us from
+ // thinking we can autofill other types of controls, e.g., password, hidden,
+ // submit.
+ if (!LowerCaseEqualsASCII(field->form_control_type(), kControlTypeText) &&
+ !LowerCaseEqualsASCII(field->form_control_type(), kControlTypeSelect))
continue;
// Generate a unique name for this field by appending a counter to the name.