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

Side by Side Diff: components/autofill/core/browser/credit_card.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/credit_card.h" 5 #include "components/autofill/core/browser/credit_card.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <ostream> 10 #include <ostream>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 CreditCard::CreditCard(const CreditCard& credit_card) 127 CreditCard::CreditCard(const CreditCard& credit_card)
128 : AutofillDataModel(std::string(), std::string()) { 128 : AutofillDataModel(std::string(), std::string()) {
129 operator=(credit_card); 129 operator=(credit_card);
130 } 130 }
131 131
132 CreditCard::~CreditCard() {} 132 CreditCard::~CreditCard() {}
133 133
134 // static 134 // static
135 const base::string16 CreditCard::StripSeparators(const base::string16& number) { 135 const base::string16 CreditCard::StripSeparators(const base::string16& number) {
136 const char16 kSeparators[] = {'-', ' ', '\0'}; 136 const base::char16 kSeparators[] = {'-', ' ', '\0'};
137 base::string16 stripped; 137 base::string16 stripped;
138 RemoveChars(number, kSeparators, &stripped); 138 base::RemoveChars(number, kSeparators, &stripped);
139 return stripped; 139 return stripped;
140 } 140 }
141 141
142 // static 142 // static
143 base::string16 CreditCard::TypeForDisplay(const std::string& type) { 143 base::string16 CreditCard::TypeForDisplay(const std::string& type) {
144 if (type == kAmericanExpressCard) 144 if (type == kAmericanExpressCard)
145 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_AMEX); 145 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_AMEX);
146 if (type == kDinersCard) 146 if (type == kDinersCard)
147 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_DINERS); 147 return l10n_util::GetStringUTF16(IDS_AUTOFILL_CC_DINERS);
148 if (type == kDiscoverCard) 148 if (type == kDiscoverCard)
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 const char* const kAmericanExpressCard = "americanExpressCC"; 683 const char* const kAmericanExpressCard = "americanExpressCC";
684 const char* const kDinersCard = "dinersCC"; 684 const char* const kDinersCard = "dinersCC";
685 const char* const kDiscoverCard = "discoverCC"; 685 const char* const kDiscoverCard = "discoverCC";
686 const char* const kGenericCard = "genericCC"; 686 const char* const kGenericCard = "genericCC";
687 const char* const kJCBCard = "jcbCC"; 687 const char* const kJCBCard = "jcbCC";
688 const char* const kMasterCard = "masterCardCC"; 688 const char* const kMasterCard = "masterCardCC";
689 const char* const kUnionPay = "unionPayCC"; 689 const char* const kUnionPay = "unionPayCC";
690 const char* const kVisaCard = "visaCC"; 690 const char* const kVisaCard = "visaCC";
691 691
692 } // namespace autofill 692 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698