summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/form_manager.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 02:28:13 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-07 02:28:13 +0000
commitf8b079c3c5e9691780d9ff8be2e1c2f5c68dc17e (patch)
treea4f9fcd85391ba5cf7d4a8d25634eda260d14a66 /chrome/renderer/form_manager.cc
parent4dd4224c9701c98a912bfd84dfcd24be2ce47d38 (diff)
downloadchromium_src-f8b079c3c5e9691780d9ff8be2e1c2f5c68dc17e.zip
chromium_src-f8b079c3c5e9691780d9ff8be2e1c2f5c68dc17e.tar.gz
chromium_src-f8b079c3c5e9691780d9ff8be2e1c2f5c68dc17e.tar.bz2
AutoFill: Re-enable label scraping.
BUG=40306 TEST=FormManagerTest.* Review URL: http://codereview.chromium.org/1575020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/form_manager.cc')
-rw-r--r--chrome/renderer/form_manager.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/renderer/form_manager.cc b/chrome/renderer/form_manager.cc
index 5bd22e5..78fd488 100644
--- a/chrome/renderer/form_manager.cc
+++ b/chrome/renderer/form_manager.cc
@@ -161,6 +161,18 @@ bool FormManager::WebFormElementToFormData(const WebFormElement& element,
iter->second->set_label(label.innerText());
}
+ for (size_t i = 0; i < control_elements.size(); ++i) {
+ const WebFormControlElement& control_element = control_elements[i];
+
+ std::map<string16, FormField*>::iterator iter =
+ name_map.find(control_element.nameForAutofill());
+ if (iter == name_map.end())
+ continue;
+
+ if (iter->second->label().empty())
+ iter->second->set_label(InferLabelForElement(control_element));
+ }
+
// Copy the created FormFields into the resulting FormData object.
for (ScopedVector<FormField>::const_iterator iter = form_fields.begin();
iter != form_fields.end(); ++iter) {