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

Unified Diff: chrome/renderer/form_manager.cc

Issue 651002: AutoFill forms. We do this by responding to a message from WebKit which send... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months 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/common/render_messages_internal.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/form_manager.cc
===================================================================
--- chrome/renderer/form_manager.cc (revision 39307)
+++ chrome/renderer/form_manager.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/renderer/form_manager.h"
#include "base/logging.h"
+#include "base/string_util.h"
#include "base/stl_util-inl.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/WebKit/chromium/public/WebNode.h"
@@ -42,7 +43,9 @@
form_elements->form_element.getInputElements(input_elements);
for (size_t j = 0; j < input_elements.size(); ++j) {
WebInputElement element = input_elements[j];
- form_elements->input_elements[element.nameForAutofill()] = element;
+ // TODO(jhawkins): Remove this check when we have labels.
+ if (!element.nameForAutofill().isEmpty())
+ form_elements->input_elements[element.nameForAutofill()] = element;
}
form_elements_map_[frame].push_back(form_elements);
@@ -120,7 +123,7 @@
for (FormInputElementMap::iterator iter =
form_element->input_elements.begin();
iter != form_element->input_elements.end(); ++iter, ++i) {
- DCHECK(iter->second.nameForAutofill() == form.elements[i]);
+ DCHECK_EQ(form.elements[i], iter->second.nameForAutofill());
iter->second.setValue(form.values[i]);
iter->second.setAutofilled(true);
« no previous file with comments | « chrome/common/render_messages_internal.h ('k') | chrome/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698