summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 20:22:14 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-29 20:22:14 +0000
commit1c46efd3b3de62d6d17f44af2883454bbed45ff4 (patch)
tree373104f4e6747d92ebd6ce3c2776731fd8ca4efa /chrome/browser/autofill
parent5ec892c39b8d9213af44629a676c97912c1c856e (diff)
downloadchromium_src-1c46efd3b3de62d6d17f44af2883454bbed45ff4.zip
chromium_src-1c46efd3b3de62d6d17f44af2883454bbed45ff4.tar.gz
chromium_src-1c46efd3b3de62d6d17f44af2883454bbed45ff4.tar.bz2
AutoFill: Remove a static string16.
BUG=50669 TEST=none Review URL: http://codereview.chromium.org/3013043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54176 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/autofill_manager.cc4
-rw-r--r--chrome/browser/autofill/credit_card.cc16
2 files changed, 12 insertions, 8 deletions
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index c1a5369..5865235 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -39,8 +39,8 @@ const int kAutoFillPhoneNumberPrefixCount = 3;
const int kAutoFillPhoneNumberSuffixOffset = 3;
const int kAutoFillPhoneNumberSuffixCount = 4;
-const string16::value_type kCreditCardPrefix[] = {'*', 0};
-const string16::value_type kLabelSeparator[] = {';',' ', '*', 0};
+const string16::value_type kCreditCardPrefix[] = {'*',0};
+const string16::value_type kLabelSeparator[] = {';',' ','*',0};
// Combines the |label| string with the last four digits of the credit card
// |cc|. If one, the other, or both are empty strings we omit the separator.
diff --git a/chrome/browser/autofill/credit_card.cc b/chrome/browser/autofill/credit_card.cc
index de2a740..7c9bbda 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;