Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: components/autofill/core/browser/autofill_profile.cc

Issue 1110833002: [autofill] Sync server card and address metadata. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_profile.cc
diff --git a/components/autofill/core/browser/autofill_profile.cc b/components/autofill/core/browser/autofill_profile.cc
index 5d582b303dec24570dca2782854ddac327b9ac08..1ef4fef12effc1879853e4ebf25798bb22eecca7 100644
--- a/components/autofill/core/browser/autofill_profile.cc
+++ b/components/autofill/core/browser/autofill_profile.cc
@@ -254,9 +254,9 @@ AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id)
record_type_(type),
name_(1),
email_(1),
- phone_number_(1, PhoneNumber(this)),
- server_id_(server_id) {
+ phone_number_(1, PhoneNumber(this)) {
DCHECK(type == SERVER_PROFILE);
+ set_server_id(server_id);
}
AutofillProfile::AutofillProfile()
@@ -276,6 +276,7 @@ AutofillProfile::~AutofillProfile() {
}
AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) {
+ set_server_id(profile.server_id());
set_use_count(profile.use_count());
set_use_date(profile.use_date());
set_modification_date(profile.modification_date());
@@ -299,8 +300,6 @@ AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) {
address_ = profile.address_;
set_language_code(profile.language_code());
- server_id_ = profile.server_id();
-
return *this;
}
@@ -838,7 +837,7 @@ void AutofillProfile::GenerateServerProfileIdentifier() {
contents.append(MultiString(*this, PHONE_HOME_WHOLE_NUMBER));
std::string contents_utf8 = UTF16ToUTF8(contents);
contents_utf8.append(language_code());
- server_id_ = base::SHA1HashString(contents_utf8);
+ set_server_id(base::SHA1HashString(contents_utf8));
}
// static

Powered by Google App Engine
This is Rietveld 408576698