diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 23:51:24 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-15 23:51:24 +0000 |
commit | 45c6e53a2c50e19a3f79fcc6f05914793ed93de6 (patch) | |
tree | e4f0c22f63fe5197938dc868f00c7d6a8e2ea8a6 /webkit/glue/dom_operations.cc | |
parent | cffa2055808bf2149ce48118dcacde477b7ead60 (diff) | |
download | chromium_src-45c6e53a2c50e19a3f79fcc6f05914793ed93de6.zip chromium_src-45c6e53a2c50e19a3f79fcc6f05914793ed93de6.tar.gz chromium_src-45c6e53a2c50e19a3f79fcc6f05914793ed93de6.tar.bz2 |
FormFieldValues -> FormData consolidation: Use webkit_glue::FormField to store field data in FormData instead of storing the field data separately in the struct.
BUG=33032
TEST=none
Review URL: http://codereview.chromium.org/847002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/dom_operations.cc')
-rw-r--r-- | webkit/glue/dom_operations.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/webkit/glue/dom_operations.cc b/webkit/glue/dom_operations.cc index 9996675..f42270d 100644 --- a/webkit/glue/dom_operations.cc +++ b/webkit/glue/dom_operations.cc @@ -175,8 +175,8 @@ static bool FillFormImpl(FormElements* fe, const FormData& data) { return false; std::map<string16, string16> data_map; - for (unsigned int i = 0; i < data.elements.size(); i++) { - data_map[data.elements[i]] = data.values[i]; + for (size_t i = 0; i < data.fields.size(); i++) { + data_map[data.fields[i].name()] = data.fields[i].value(); } for (FormInputElementMap::iterator it = fe->input_elements.begin(); @@ -199,9 +199,9 @@ static bool FindFormInputElements(WebFormElement* fe, // Loop through the list of elements we need to find on the form in // order to autofill it. If we don't find any one of them, abort // processing this form; it can't be the right one. - for (size_t j = 0; j < data.elements.size(); j++) { + for (size_t j = 0; j < data.fields.size(); j++) { WebVector<WebNode> temp_elements; - fe->getNamedElements(data.elements[j], temp_elements); + fe->getNamedElements(data.fields[j].name(), temp_elements); if (temp_elements.isEmpty()) { // We didn't find a required element. This is not the right form. // Make sure no input elements from a partially matched form @@ -215,7 +215,7 @@ static bool FindFormInputElements(WebFormElement* fe, // one suffices and if some function needs to deal with multiple // matching elements it can get at them through the FormElement*. // Note: This assignment adds a reference to the InputElement. - result->input_elements[data.elements[j]] = + result->input_elements[data.fields[j].name()] = temp_elements[0].toElement<WebInputElement>(); } return true; @@ -286,12 +286,12 @@ void FillPasswordForm(WebView* view, // Attach autocomplete listener to enable selecting alternate logins. // First, get pointers to username element. WebInputElement username_element = - form_elements->input_elements[data.basic_data.elements[0]]; + form_elements->input_elements[data.basic_data.fields[0].name()]; // Get pointer to password element. (We currently only support single // password forms). WebInputElement password_element = - form_elements->input_elements[data.basic_data.elements[1]]; + form_elements->input_elements[data.basic_data.fields[1].name()]; username_element.frame()->registerPasswordListener( username_element, |