diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-20 01:04:48 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-20 01:04:48 +0000 |
commit | c8364173b3b961393748baafdce46a9bcf422879 (patch) | |
tree | c47799fe71f7e8bcf208a5918293e46aa702cb8c /chrome/browser/autofill/form_structure.cc | |
parent | d892b0c423cfb0cc398c85e5bff1fd9239f77f80 (diff) | |
download | chromium_src-c8364173b3b961393748baafdce46a9bcf422879.zip chromium_src-c8364173b3b961393748baafdce46a9bcf422879.tar.gz chromium_src-c8364173b3b961393748baafdce46a9bcf422879.tar.bz2 |
AutoFill forms. We do this by responding to a message from WebKit which sends the (name, label) key requested to fill out a specific field. The RenderView finds the form to AutoFill using the FormManager and requests the AutoFillManager to fill in the data for the form. At the end, the FormManager uses this data to fill out the fields in the form on the web page.
BUG=18201
TEST=none
Review URL: http://codereview.chromium.org/651002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/form_structure.cc')
-rw-r--r-- | chrome/browser/autofill/form_structure.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/autofill/form_structure.cc b/chrome/browser/autofill/form_structure.cc index ca3acc5..f1e8025 100644 --- a/chrome/browser/autofill/form_structure.cc +++ b/chrome/browser/autofill/form_structure.cc @@ -12,6 +12,7 @@ #include "chrome/browser/autofill/field_types.h" #include "chrome/browser/autofill/form_field.h" #include "third_party/libjingle/files/talk/xmllite/xmlelement.h" +#include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" #include "webkit/glue/form_field_values.h" @@ -202,6 +203,20 @@ size_t FormStructure::field_count() const { return fields_.size() - 1; } +bool FormStructure::operator!=(const FormData& form) const { + // TODO(jhawkins): Is this enough to differentiate a form? + if (UTF8ToUTF16(form_name_) != form.name || + source_url_ != form.origin || + target_url_ != form.action) { + return true; + } + + // TODO(jhawkins): Compare field names, IDs and labels once we have labels + // set up. + + return false; +} + void FormStructure::GetHeuristicFieldInfo(FieldTypeMap* field_type_map) { FormFieldSet fields = FormFieldSet(this); |