| OLD | NEW |
| 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 <ostream> | 10 #include <ostream> |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 name_ = profile.name_; | 256 name_ = profile.name_; |
| 257 email_ = profile.email_; | 257 email_ = profile.email_; |
| 258 company_ = profile.company_; | 258 company_ = profile.company_; |
| 259 phone_number_ = profile.phone_number_; | 259 phone_number_ = profile.phone_number_; |
| 260 | 260 |
| 261 for (size_t i = 0; i < phone_number_.size(); ++i) | 261 for (size_t i = 0; i < phone_number_.size(); ++i) |
| 262 phone_number_[i].set_profile(this); | 262 phone_number_[i].set_profile(this); |
| 263 | 263 |
| 264 address_ = profile.address_; | 264 address_ = profile.address_; |
| 265 set_language_code(profile.language_code()); |
| 265 | 266 |
| 266 return *this; | 267 return *this; |
| 267 } | 268 } |
| 268 | 269 |
| 269 void AutofillProfile::GetMatchingTypes( | 270 void AutofillProfile::GetMatchingTypes( |
| 270 const base::string16& text, | 271 const base::string16& text, |
| 271 const std::string& app_locale, | 272 const std::string& app_locale, |
| 272 ServerFieldTypeSet* matching_types) const { | 273 ServerFieldTypeSet* matching_types) const { |
| 273 FormGroupList info = FormGroups(); | 274 FormGroupList info = FormGroups(); |
| 274 for (FormGroupList::const_iterator it = info.begin(); it != info.end(); ++it) | 275 for (FormGroupList::const_iterator it = info.begin(); it != info.end(); ++it) |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 return -1; | 438 return -1; |
| 438 if (values_a.size() > values_b.size()) | 439 if (values_a.size() > values_b.size()) |
| 439 return 1; | 440 return 1; |
| 440 for (size_t j = 0; j < values_a.size(); ++j) { | 441 for (size_t j = 0; j < values_a.size(); ++j) { |
| 441 int comparison = values_a[j].compare(values_b[j]); | 442 int comparison = values_a[j].compare(values_b[j]); |
| 442 if (comparison != 0) | 443 if (comparison != 0) |
| 443 return comparison; | 444 return comparison; |
| 444 } | 445 } |
| 445 } | 446 } |
| 446 | 447 |
| 447 return 0; | 448 return language_code().compare(profile.language_code()); |
| 448 } | 449 } |
| 449 | 450 |
| 450 bool AutofillProfile::operator==(const AutofillProfile& profile) const { | 451 bool AutofillProfile::operator==(const AutofillProfile& profile) const { |
| 451 return guid() == profile.guid() && | 452 return guid() == profile.guid() && |
| 452 origin() == profile.origin() && | 453 origin() == profile.origin() && |
| 453 Compare(profile) == 0; | 454 Compare(profile) == 0; |
| 454 } | 455 } |
| 455 | 456 |
| 456 bool AutofillProfile::operator!=(const AutofillProfile& profile) const { | 457 bool AutofillProfile::operator!=(const AutofillProfile& profile) const { |
| 457 return !operator==(profile); | 458 return !operator==(profile); |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) | 839 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_CITY)) |
| 839 << " " | 840 << " " |
| 840 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) | 841 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_STATE)) |
| 841 << " " | 842 << " " |
| 842 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) | 843 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_ZIP)) |
| 843 << " " | 844 << " " |
| 844 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) | 845 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)) |
| 845 << " " | 846 << " " |
| 846 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) | 847 << UTF16ToUTF8(profile.GetRawInfo(ADDRESS_HOME_COUNTRY)) |
| 847 << " " | 848 << " " |
| 849 << profile.language_code() |
| 850 << " " |
| 848 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); | 851 << UTF16ToUTF8(MultiString(profile, PHONE_HOME_WHOLE_NUMBER)); |
| 849 } | 852 } |
| 850 | 853 |
| 851 } // namespace autofill | 854 } // namespace autofill |
| OLD | NEW |