| 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/content/browser/wallet/wallet_address.h" | 5 #include "components/autofill/content/browser/wallet/wallet_address.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 recipient_name_(profile.GetRawInfo(NAME_FULL)), | 125 recipient_name_(profile.GetRawInfo(NAME_FULL)), |
| 126 locality_name_(profile.GetRawInfo(ADDRESS_HOME_CITY)), | 126 locality_name_(profile.GetRawInfo(ADDRESS_HOME_CITY)), |
| 127 dependent_locality_name_( | 127 dependent_locality_name_( |
| 128 profile.GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY)), | 128 profile.GetRawInfo(ADDRESS_HOME_DEPENDENT_LOCALITY)), |
| 129 administrative_area_name_(profile.GetRawInfo(ADDRESS_HOME_STATE)), | 129 administrative_area_name_(profile.GetRawInfo(ADDRESS_HOME_STATE)), |
| 130 postal_code_number_(profile.GetRawInfo(ADDRESS_HOME_ZIP)), | 130 postal_code_number_(profile.GetRawInfo(ADDRESS_HOME_ZIP)), |
| 131 sorting_code_(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)), | 131 sorting_code_(profile.GetRawInfo(ADDRESS_HOME_SORTING_CODE)), |
| 132 phone_number_(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)), | 132 phone_number_(profile.GetRawInfo(PHONE_HOME_WHOLE_NUMBER)), |
| 133 is_complete_address_(true), | 133 is_complete_address_(true), |
| 134 language_code_(profile.language_code()) { | 134 language_code_(profile.language_code()) { |
| 135 base::SplitString( | 135 street_address_ = base::SplitString( |
| 136 profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), '\n', &street_address_); | 136 profile.GetRawInfo(ADDRESS_HOME_STREET_ADDRESS), base::ASCIIToUTF16("\n"), |
| 137 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 137 | 138 |
| 138 if (!country_name_code_.empty()) | 139 if (!country_name_code_.empty()) |
| 139 phone_object_ = i18n::PhoneObject(phone_number_, country_name_code_); | 140 phone_object_ = i18n::PhoneObject(phone_number_, country_name_code_); |
| 140 } | 141 } |
| 141 | 142 |
| 142 Address::Address(const std::string& country_name_code, | 143 Address::Address(const std::string& country_name_code, |
| 143 const base::string16& recipient_name, | 144 const base::string16& recipient_name, |
| 144 const std::vector<base::string16>& street_address, | 145 const std::vector<base::string16>& street_address, |
| 145 const base::string16& locality_name, | 146 const base::string16& locality_name, |
| 146 const base::string16& dependent_locality_name, | 147 const base::string16& dependent_locality_name, |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 language_code_ == other.language_code_ && | 412 language_code_ == other.language_code_ && |
| 412 EqualsIgnoreID(other); | 413 EqualsIgnoreID(other); |
| 413 } | 414 } |
| 414 | 415 |
| 415 bool Address::operator!=(const Address& other) const { | 416 bool Address::operator!=(const Address& other) const { |
| 416 return !(*this == other); | 417 return !(*this == other); |
| 417 } | 418 } |
| 418 | 419 |
| 419 } // namespace wallet | 420 } // namespace wallet |
| 420 } // namespace autofill | 421 } // namespace autofill |
| OLD | NEW |