phone_number_[i].set_profile(this);
address_ = profile.address_;
+ set_language_code(profile.language_code());
return *this;
}
}
}
-
int AutofillProfile::Compare(const AutofillProfile& profile) const {
const ServerFieldType single_value_types[] = {
COMPANY_NAME,
return 0;
}
-bool AutofillProfile::operator==(const AutofillProfile& profile) const {
+bool AutofillProfile::EqualsSansOrigin(const AutofillProfile& profile) const {
return guid() == profile.guid() &&
- origin() == profile.origin() &&
+ language_code() == profile.language_code() &&
+ Compare(profile) == 0;
+}
+
+bool AutofillProfile::EqualsSansGuid(const AutofillProfile& profile) const {
+ return origin() == profile.origin() &&
+ language_code() == profile.language_code() &&
Compare(profile) == 0;
}
+bool AutofillProfile::operator==(const AutofillProfile& profile) const {
+ return guid() == profile.guid() && EqualsSansGuid(profile);
+}
+
bool AutofillProfile::operator!=(const AutofillProfile& profile) const {
return !operator==(profile);
}
// Verified profiles should never be overwritten with unverified data.
DCHECK(!IsVerified() || profile.IsVerified());
set_origin(profile.origin());
+ set_language_code(profile.language_code());
ServerFieldTypeSet field_types;
profile.GetNonEmptyTypes(app_locale, &field_types);
<< " "
<< UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY))
<< " "
+ << profile.language_code()
+ << " "
<< UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER));
}