summaryrefslogtreecommitdiffstats
path: root/webkit/glue/form_field.cc
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 21:56:18 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-19 21:56:18 +0000
commitdd1b4959032fd4684534ff07dab83f71391b36aa (patch)
treefe904cf6a90dcb7a1e3795fe3c203b86f2fdca0f /webkit/glue/form_field.cc
parentde49ea10c04eb354ab0187b8f98898c272660037 (diff)
downloadchromium_src-dd1b4959032fd4684534ff07dab83f71391b36aa.zip
chromium_src-dd1b4959032fd4684534ff07dab83f71391b36aa.tar.gz
chromium_src-dd1b4959032fd4684534ff07dab83f71391b36aa.tar.bz2
AutoFill fill billing address when credit card settings specify a billing address.
Fixes address type matching in |AddressField::AddressTypeFromText| method. Also, extends |AutoFillManager::FillAutoFillFormData| method to fill associated billing address when filling a credit card that has billing information set in preferences. Adds new unit test AutoFillManagerTest.FillCreditCardFormWithBilling and fixes others. BUG=44227 TEST=AddressFieldTest.ParseOneLineAddress, \ AddressFieldTest.ParseOneLineAddressBilling, \ AddressFieldTest.ParseOneLineAddressShipping, \ AutoFillManagerTest.FillCreditCardForm, \ AutoFillManagerTest.FillCreditCardFormWithBilling, \ FormStructureTest.HeuristicsSample8, \ and manual test with everything2.html bug file. Review URL: http://codereview.chromium.org/2078016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/form_field.cc')
-rw-r--r--webkit/glue/form_field.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/webkit/glue/form_field.cc b/webkit/glue/form_field.cc
index 250f04a..0d6ac1d 100644
--- a/webkit/glue/form_field.cc
+++ b/webkit/glue/form_field.cc
@@ -56,16 +56,25 @@ FormField::FormField(const string16& label,
bool FormField::operator==(const FormField& field) const {
// A FormField stores a value, but the value is not part of the identity of
- // the field, so we don't want to compare the values. Same goes for |size_|.
+ // the field, so we don't want to compare the values.
return (label_ == field.label_ &&
name_ == field.name_ &&
- form_control_type_ == field.form_control_type_);
+ form_control_type_ == field.form_control_type_ &&
+ size_ == field.size_);
}
bool FormField::operator!=(const FormField& field) const {
return !operator==(field);
}
+bool FormField::StrictlyEqualsHack(const FormField& field) const {
+ return (label_ == field.label_ &&
+ name_ == field.name_ &&
+ value_ == field.value_ &&
+ form_control_type_ == field.form_control_type_ &&
+ size_ == field.size_);
+}
+
std::ostream& operator<<(std::ostream& os, const FormField& field) {
return os
<< UTF16ToUTF8(field.label())