X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcomponents%2Fautofill%2Fcore%2Fbrowser%2Fautofill_profile.cc;h=02d6197e8176a0128b5d24ea78b932e329d3c1ef;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=3e7e7aa14c5a5195f8b7fa5bca780f49c3c042a7;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/components/autofill/core/browser/autofill_profile.cc b/src/components/autofill/core/browser/autofill_profile.cc index 3e7e7aa..02d6197 100644 --- a/src/components/autofill/core/browser/autofill_profile.cc +++ b/src/components/autofill/core/browser/autofill_profile.cc @@ -262,6 +262,7 @@ AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) { phone_number_[i].set_profile(this); address_ = profile.address_; + set_language_code(profile.language_code()); return *this; } @@ -401,7 +402,6 @@ bool AutofillProfile::IsPresentButInvalid(ServerFieldType type) const { } } - int AutofillProfile::Compare(const AutofillProfile& profile) const { const ServerFieldType single_value_types[] = { COMPANY_NAME, @@ -447,12 +447,22 @@ int AutofillProfile::Compare(const AutofillProfile& profile) const { 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); } @@ -500,6 +510,7 @@ void AutofillProfile::OverwriteWithOrAddTo(const AutofillProfile& 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); @@ -845,6 +856,8 @@ std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile) { << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " + << profile.language_code() + << " " << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); }