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

Unified Diff: chrome/browser/autofill/credit_card.cc

Issue 3013043: AutoFill: Remove a static string16. (Closed)
Patch Set: One line. Created 10 years, 5 months 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
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/credit_card.cc
diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc
index de2a740824ed61001f05d6804fdcede9666785f4..7c9bbda56abfe05ec9b883081814a3d51b869dfb 100644
--- a/chrome/browser/autofill/credit_card.cc
+++ b/chrome/browser/autofill/credit_card.cc
@@ -7,15 +7,18 @@
#include "app/l10n_util.h"
#include "base/basictypes.h"
#include "base/string_util.h"
+#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/autofill/autofill_type.h"
#include "chrome/browser/autofill/field_types.h"
#include "grit/generated_resources.h"
-static const string16 kCreditCardSeparators = ASCIIToUTF16(" -");
-static const char* kCreditCardObfuscationString = "************";
+namespace {
-static const AutoFillFieldType kAutoFillCreditCardTypes[] = {
+const string16::value_type kCreditCardSeparators[] = {' ','-',0};
+const char* kCreditCardObfuscationString = "************";
+
+const AutoFillFieldType kAutoFillCreditCardTypes[] = {
CREDIT_CARD_NAME,
CREDIT_CARD_NUMBER,
CREDIT_CARD_TYPE,
@@ -23,8 +26,9 @@ static const AutoFillFieldType kAutoFillCreditCardTypes[] = {
CREDIT_CARD_EXP_4_DIGIT_YEAR,
};
-static const int kAutoFillCreditCardLength =
- arraysize(kAutoFillCreditCardTypes);
+const int kAutoFillCreditCardLength = arraysize(kAutoFillCreditCardTypes);
+
+} // namespace
CreditCard::CreditCard(const string16& label, int unique_id)
: expiration_month_(0),
@@ -309,7 +313,7 @@ bool CreditCard::operator!=(const CreditCard& creditcard) const {
// static
bool CreditCard::IsCreditCardNumber(const string16& text) {
string16 number;
- RemoveChars(text, kCreditCardSeparators.c_str(), &number);
+ RemoveChars(text, kCreditCardSeparators, &number);
int sum = 0;
bool odd = false;
« no previous file with comments | « chrome/browser/autofill/autofill_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698