diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 22:41:17 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-22 22:41:17 +0000 |
commit | fbf90315b8420502dbad77b9741f7547b3f2187e (patch) | |
tree | c4068cffb9fa9dfb6eb1fec5abc0cf5bf4828f6f /chrome/renderer/form_manager.cc | |
parent | 0d76062cda4c5654b28cfd0a6c429166fb716f75 (diff) | |
download | chromium_src-fbf90315b8420502dbad77b9741f7547b3f2187e.zip chromium_src-fbf90315b8420502dbad77b9741f7547b3f2187e.tar.gz chromium_src-fbf90315b8420502dbad77b9741f7547b3f2187e.tar.bz2 |
AutoFill: Also use the form action to uniquely identify which form to fill in
FormManager::FillForm.
BUG=42271
TEST=FormManagerTest.FillFormEmptyFormNames
Review URL: http://codereview.chromium.org/1736011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/form_manager.cc')
-rw-r--r-- | chrome/renderer/form_manager.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/renderer/form_manager.cc b/chrome/renderer/form_manager.cc index c66cd74..19ae004 100644 --- a/chrome/renderer/form_manager.cc +++ b/chrome/renderer/form_manager.cc @@ -366,16 +366,20 @@ bool FormManager::FillForm(const FormData& form) { for (WebFrameFormElementMap::iterator iter = form_elements_map_.begin(); iter != form_elements_map_.end(); ++iter) { + const WebFrame* frame = iter->first; + for (std::vector<FormElement*>::iterator form_iter = iter->second.begin(); form_iter != iter->second.end(); ++form_iter) { // TODO(dhollowa): matching on form name here which is not guaranteed to // be unique for the page, nor is it guaranteed to be non-empty. Need to - // find a way to uniquely identify the form cross-process. + // find a way to uniquely identify the form cross-process. For now we'll + // check form name and form action for identity. // http://crbug.com/37990 test file sample8.html. // Also note that WebString() == WebString(string16()) does not seem to // evaluate to |true| for some reason TBD, so forcing to string16. string16 element_name((*form_iter)->form_element.name()); - if (element_name == form.name) { + GURL action(frame->completeURL((*form_iter)->form_element.action())); + if (element_name == form.name && action == form.action) { form_element = *form_iter; break; } |