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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // impose our own. phone_number() always includes a country code, so using | 307 // impose our own. phone_number() always includes a country code, so using |
308 // PhoneObject to format it would result in an internationalized format. Since | 308 // PhoneObject to format it would result in an internationalized format. Since |
309 // Wallet only supports the US right now, stick to national formatting. | 309 // Wallet only supports the US right now, stick to national formatting. |
310 return i18n::PhoneObject(phone_number(), country_name_code()). | 310 return i18n::PhoneObject(phone_number(), country_name_code()). |
311 GetNationallyFormattedNumber(); | 311 GetNationallyFormattedNumber(); |
312 } | 312 } |
313 | 313 |
314 base::string16 Address::GetInfo(const AutofillType& type, | 314 base::string16 Address::GetInfo(const AutofillType& type, |
315 const std::string& app_locale) const { | 315 const std::string& app_locale) const { |
316 if (type.html_type() == HTML_TYPE_COUNTRY_CODE) { | 316 if (type.html_type() == HTML_TYPE_COUNTRY_CODE) { |
317 DCHECK(IsStringASCII(country_name_code())); | 317 DCHECK(base::IsStringASCII(country_name_code())); |
318 return base::ASCIIToUTF16(country_name_code()); | 318 return base::ASCIIToUTF16(country_name_code()); |
319 } | 319 } |
320 | 320 |
321 switch (type.GetStorableType()) { | 321 switch (type.GetStorableType()) { |
322 case NAME_FULL: | 322 case NAME_FULL: |
323 return recipient_name(); | 323 return recipient_name(); |
324 | 324 |
325 case ADDRESS_HOME_STREET_ADDRESS: | 325 case ADDRESS_HOME_STREET_ADDRESS: |
326 return JoinString(street_address_, base::ASCIIToUTF16("\n")); | 326 return JoinString(street_address_, base::ASCIIToUTF16("\n")); |
327 | 327 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 bool Address::operator==(const Address& other) const { | 392 bool Address::operator==(const Address& other) const { |
393 return object_id_ == other.object_id_ && EqualsIgnoreID(other); | 393 return object_id_ == other.object_id_ && EqualsIgnoreID(other); |
394 } | 394 } |
395 | 395 |
396 bool Address::operator!=(const Address& other) const { | 396 bool Address::operator!=(const Address& other) const { |
397 return !(*this == other); | 397 return !(*this == other); |
398 } | 398 } |
399 | 399 |
400 } // namespace wallet | 400 } // namespace wallet |
401 } // namespace autofill | 401 } // namespace autofill |
OLD | NEW |