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

Side by Side Diff: components/autofill/core/browser/autofill_profile.cc

Issue 2626263005: [Autofill] Sync new wallet metadata fields through Chrome Sync. (Closed)
Patch Set: Addressed comments Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/autofill/core/browser/autofill_profile.h" 5 #include "components/autofill/core/browser/autofill_profile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 } 189 }
190 } 190 }
191 191
192 } // namespace 192 } // namespace
193 193
194 AutofillProfile::AutofillProfile(const std::string& guid, 194 AutofillProfile::AutofillProfile(const std::string& guid,
195 const std::string& origin) 195 const std::string& origin)
196 : AutofillDataModel(guid, origin), 196 : AutofillDataModel(guid, origin),
197 record_type_(LOCAL_PROFILE), 197 record_type_(LOCAL_PROFILE),
198 phone_number_(this) { 198 phone_number_(this),
199 } 199 has_converted_(false) {}
200 200
201 AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id) 201 AutofillProfile::AutofillProfile(RecordType type, const std::string& server_id)
202 : AutofillDataModel(base::GenerateGUID(), std::string()), 202 : AutofillDataModel(base::GenerateGUID(), std::string()),
203 record_type_(type), 203 record_type_(type),
204 phone_number_(this), 204 phone_number_(this),
205 server_id_(server_id) { 205 server_id_(server_id),
206 has_converted_(false) {
206 DCHECK(type == SERVER_PROFILE); 207 DCHECK(type == SERVER_PROFILE);
207 } 208 }
208 209
209 AutofillProfile::AutofillProfile() 210 AutofillProfile::AutofillProfile()
210 : AutofillDataModel(base::GenerateGUID(), std::string()), 211 : AutofillDataModel(base::GenerateGUID(), std::string()),
211 record_type_(LOCAL_PROFILE), 212 record_type_(LOCAL_PROFILE),
212 phone_number_(this) { 213 phone_number_(this),
213 } 214 has_converted_(false) {}
214 215
215 AutofillProfile::AutofillProfile(const AutofillProfile& profile) 216 AutofillProfile::AutofillProfile(const AutofillProfile& profile)
216 : AutofillDataModel(std::string(), std::string()), phone_number_(this) { 217 : AutofillDataModel(std::string(), std::string()), phone_number_(this) {
217 operator=(profile); 218 operator=(profile);
218 } 219 }
219 220
220 AutofillProfile::~AutofillProfile() { 221 AutofillProfile::~AutofillProfile() {
221 } 222 }
222 223
223 AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) { 224 AutofillProfile& AutofillProfile::operator=(const AutofillProfile& profile) {
(...skipping 12 matching lines...) Expand all
236 name_ = profile.name_; 237 name_ = profile.name_;
237 email_ = profile.email_; 238 email_ = profile.email_;
238 company_ = profile.company_; 239 company_ = profile.company_;
239 phone_number_ = profile.phone_number_; 240 phone_number_ = profile.phone_number_;
240 phone_number_.set_profile(this); 241 phone_number_.set_profile(this);
241 242
242 address_ = profile.address_; 243 address_ = profile.address_;
243 set_language_code(profile.language_code()); 244 set_language_code(profile.language_code());
244 245
245 server_id_ = profile.server_id(); 246 server_id_ = profile.server_id();
247 has_converted_ = profile.has_converted();
246 248
247 return *this; 249 return *this;
248 } 250 }
249 251
250 // TODO(crbug.com/589535): Disambiguate similar field types before uploading. 252 // TODO(crbug.com/589535): Disambiguate similar field types before uploading.
251 void AutofillProfile::GetMatchingTypes( 253 void AutofillProfile::GetMatchingTypes(
252 const base::string16& text, 254 const base::string16& text,
253 const std::string& app_locale, 255 const std::string& app_locale,
254 ServerFieldTypeSet* matching_types) const { 256 ServerFieldTypeSet* matching_types) const {
255 FormGroupList info = FormGroups(); 257 FormGroupList info = FormGroups();
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " " 857 << " " << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) << " "
856 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " " 858 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) << " "
857 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " " 859 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) << " "
858 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " " 860 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) << " "
859 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " " 861 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) << " "
860 << profile.language_code() << " " 862 << profile.language_code() << " "
861 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)); 863 << UTF16ToUTF8(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER));
862 } 864 }
863 865
864 } // namespace autofill 866 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698