| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // impose our own. phone_number() always includes a country code, so using | 323 // impose our own. phone_number() always includes a country code, so using |
| 324 // PhoneObject to format it would result in an internationalized format. Since | 324 // PhoneObject to format it would result in an internationalized format. Since |
| 325 // Wallet only supports the US right now, stick to national formatting. | 325 // Wallet only supports the US right now, stick to national formatting. |
| 326 return i18n::PhoneObject(phone_number(), country_name_code()). | 326 return i18n::PhoneObject(phone_number(), country_name_code()). |
| 327 GetNationallyFormattedNumber(); | 327 GetNationallyFormattedNumber(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 base::string16 Address::GetInfo(const AutofillType& type, | 330 base::string16 Address::GetInfo(const AutofillType& type, |
| 331 const std::string& app_locale) const { | 331 const std::string& app_locale) const { |
| 332 if (type.html_type() == HTML_TYPE_COUNTRY_CODE) { | 332 if (type.html_type() == HTML_TYPE_COUNTRY_CODE) { |
| 333 DCHECK(IsStringASCII(country_name_code())); | 333 DCHECK(base::IsStringASCII(country_name_code())); |
| 334 return base::ASCIIToUTF16(country_name_code()); | 334 return base::ASCIIToUTF16(country_name_code()); |
| 335 } | 335 } |
| 336 | 336 |
| 337 switch (type.GetStorableType()) { | 337 switch (type.GetStorableType()) { |
| 338 case NAME_FULL: | 338 case NAME_FULL: |
| 339 return recipient_name(); | 339 return recipient_name(); |
| 340 | 340 |
| 341 case ADDRESS_HOME_STREET_ADDRESS: | 341 case ADDRESS_HOME_STREET_ADDRESS: |
| 342 return JoinString(street_address_, base::ASCIIToUTF16("\n")); | 342 return JoinString(street_address_, base::ASCIIToUTF16("\n")); |
| 343 | 343 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 language_code_ == other.language_code_ && | 410 language_code_ == other.language_code_ && |
| 411 EqualsIgnoreID(other); | 411 EqualsIgnoreID(other); |
| 412 } | 412 } |
| 413 | 413 |
| 414 bool Address::operator!=(const Address& other) const { | 414 bool Address::operator!=(const Address& other) const { |
| 415 return !(*this == other); | 415 return !(*this == other); |
| 416 } | 416 } |
| 417 | 417 |
| 418 } // namespace wallet | 418 } // namespace wallet |
| 419 } // namespace autofill | 419 } // namespace autofill |
| OLD | NEW |