| Index: chrome/browser/autofill/autofill_profile.cc
|
| diff --git a/chrome/browser/autofill/autofill_profile.cc b/chrome/browser/autofill/autofill_profile.cc
|
| index 45122b1d6d204856343537e8368d14caaed55536..bdeab8370d66091795e05a20be96190330243b81 100644
|
| --- a/chrome/browser/autofill/autofill_profile.cc
|
| +++ b/chrome/browser/autofill/autofill_profile.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/autofill/autofill_profile.h"
|
|
|
| #include <algorithm>
|
| +#include <functional>
|
| #include <map>
|
| #include <set>
|
|
|
| @@ -537,6 +538,16 @@ const string16 AutofillProfile::PrimaryValue() const {
|
| GetInfo(ADDRESS_HOME_CITY);
|
| }
|
|
|
| +// Functor used to check for case-insensitive equality of two strings.
|
| +struct CaseInsensitiveStringEquals
|
| + : public std::binary_function<string16, string16, bool>
|
| +{
|
| + bool operator()(const string16& x, const string16& y) const {
|
| + return std::equal(x.begin(), x.end(), y.begin(),
|
| + base::CaseInsensitiveCompare<string16::value_type>());
|
| + }
|
| +};
|
| +
|
| void AutofillProfile::OverwriteWithOrAddTo(const AutofillProfile& profile) {
|
| FieldTypeSet field_types;
|
| profile.GetNonEmptyTypes(&field_types);
|
| @@ -560,10 +571,11 @@ void AutofillProfile::OverwriteWithOrAddTo(const AutofillProfile& profile) {
|
| group == AutofillType::PHONE_FAX) {
|
| AddPhoneIfUnique(*value_iter, &existing_values);
|
| } else {
|
| - if (std::find(existing_values.begin(), existing_values.end(),
|
| - *value_iter) == existing_values.end()) {
|
| + std::vector<string16>::const_iterator existing_iter = std::find_if(
|
| + existing_values.begin(), existing_values.end(),
|
| + std::bind1st(CaseInsensitiveStringEquals(), *value_iter));
|
| + if (existing_iter == existing_values.end())
|
| existing_values.insert(existing_values.end(), *value_iter);
|
| - }
|
| }
|
| }
|
| SetMultiInfo(*iter, existing_values);
|
|
|