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

Unified Diff: components/autofill/core/browser/credit_card.cc

Issue 112433004: Update uses of UTF conversions in chrome_frame/, chromeos/, components/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/credit_card.cc
diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc
index 2d62c5e116f98e2da5944a068c43e37bf48de1ae..6964aa496aaecb87a073316e9a359fe43f202c10 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -307,7 +307,7 @@ base::string16 CreditCard::GetRawInfo(ServerFieldType type) const {
base::string16 month = ExpirationMonthAsString();
base::string16 year = Expiration2DigitYearAsString();
if (!month.empty() && !year.empty())
- return month + ASCIIToUTF16("/") + year;
+ return month + base::ASCIIToUTF16("/") + year;
return base::string16();
}
@@ -315,7 +315,7 @@ base::string16 CreditCard::GetRawInfo(ServerFieldType type) const {
base::string16 month = ExpirationMonthAsString();
base::string16 year = Expiration4DigitYearAsString();
if (!month.empty() && !year.empty())
- return month + ASCIIToUTF16("/") + year;
+ return month + base::ASCIIToUTF16("/") + year;
return base::string16();
}
@@ -435,7 +435,7 @@ const base::string16 CreditCard::Label() const {
// TODO(georgey): Internationalize date.
base::string16 formatted_date(ExpirationMonthAsString());
- formatted_date.append(ASCIIToUTF16("/"));
+ formatted_date.append(base::ASCIIToUTF16("/"));
formatted_date.append(Expiration4DigitYearAsString());
label = l10n_util::GetStringFUTF16(IDS_CREDIT_CARD_NUMBER_PREVIEW_FORMAT,
@@ -446,8 +446,10 @@ const base::string16 CreditCard::Label() const {
void CreditCard::SetInfoForMonthInputType(const base::string16& value) {
// Check if |text| is "yyyy-mm" format first, and check normal month format.
- if (!autofill::MatchesPattern(value, UTF8ToUTF16("^[0-9]{4}-[0-9]{1,2}$")))
+ if (!autofill::MatchesPattern(value,
+ base::UTF8ToUTF16("^[0-9]{4}-[0-9]{1,2}$"))) {
return;
+ }
std::vector<base::string16> year_month;
base::SplitString(value, L'-', &year_month);
@@ -499,7 +501,7 @@ base::string16 CreditCard::TypeAndLastFourDigits() const {
return type;
// TODO(estade): i18n.
- return type + ASCIIToUTF16(" - ") + digits;
+ return type + base::ASCIIToUTF16(" - ") + digits;
}
void CreditCard::operator=(const CreditCard& credit_card) {
@@ -612,7 +614,7 @@ base::string16 CreditCard::ExpirationMonthAsString() const {
if (expiration_month_ >= 10)
return month;
- base::string16 zero = ASCIIToUTF16("0");
+ base::string16 zero = base::ASCIIToUTF16("0");
zero.append(month);
return zero;
}
@@ -672,21 +674,22 @@ void CreditCard::SetExpirationYear(int expiration_year) {
// So we can compare CreditCards with EXPECT_EQ().
std::ostream& operator<<(std::ostream& os, const CreditCard& credit_card) {
return os
- << UTF16ToUTF8(credit_card.Label())
+ << base::UTF16ToUTF8(credit_card.Label())
<< " "
<< credit_card.guid()
<< " "
<< credit_card.origin()
<< " "
- << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NAME))
+ << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NAME))
<< " "
- << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_TYPE))
+ << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_TYPE))
<< " "
- << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NUMBER))
+ << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_NUMBER))
<< " "
- << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_EXP_MONTH))
+ << base::UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_EXP_MONTH))
<< " "
- << UTF16ToUTF8(credit_card.GetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR));
+ << base::UTF16ToUTF8(
+ credit_card.GetRawInfo(CREDIT_CARD_EXP_4_DIGIT_YEAR));
}
// These values must match the values in WebKitPlatformSupportImpl in
« no previous file with comments | « components/autofill/core/browser/contact_info_unittest.cc ('k') | components/autofill/core/browser/credit_card_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698