#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/form_field_data.h"
-#include "grit/component_strings.h"
+#include "grit/component_scaled_resources.h"
+#include "grit/components_strings.h"
#include "third_party/icu/source/common/unicode/uloc.h"
#include "third_party/icu/source/i18n/unicode/dtfmtsym.h"
#include "ui/base/l10n/l10n_util.h"
-// TODO(blundell): Eliminate the need for this conditional include.
-// crbug.com/328150
-#if !defined(OS_IOS)
-#include "grit/webkit_resources.h"
-#endif
-
namespace autofill {
namespace {
// Otherwise, try parsing the |month| as a named month, e.g. "January" or
// "Jan".
- base::string16 lowercased_month = StringToLowerASCII(month);
+ base::string16 lowercased_month = base::StringToLowerASCII(month);
UErrorCode status = U_ZERO_ERROR;
icu::Locale locale(app_locale.c_str());
for (int32_t i = 0; i < num_months; ++i) {
const base::string16 icu_month = base::string16(months[i].getBuffer(),
months[i].length());
- if (lowercased_month == StringToLowerASCII(icu_month)) {
+ if (lowercased_month == base::StringToLowerASCII(icu_month)) {
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
return true;
}
for (int32_t i = 0; i < num_months; ++i) {
const base::string16 icu_month = base::string16(months[i].getBuffer(),
months[i].length());
- if (lowercased_month == StringToLowerASCII(icu_month)) {
+ if (lowercased_month == base::StringToLowerASCII(icu_month)) {
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
return true;
}
// static
const base::string16 CreditCard::StripSeparators(const base::string16& number) {
- const base::char16 kSeparators[] = {'-', ' ', '\0'};
base::string16 stripped;
- base::RemoveChars(number, kSeparators, &stripped);
+ base::RemoveChars(number, base::ASCIIToUTF16("- "), &stripped);
return stripped;
}
// static
int CreditCard::IconResourceId(const std::string& type) {
- // TODO(blundell): Either move these resources out of webkit_resources or
- // this function into //components/autofill/content/browser to eliminate the
- // need for this ifdef-ing. crbug.com/328150
-#if defined(OS_IOS)
- return 0;
-#else
if (type == kAmericanExpressCard)
return IDR_AUTOFILL_CC_AMEX;
if (type == kDinersCard)
// include a new card.
DCHECK_EQ(kGenericCard, type);
return IDR_AUTOFILL_CC_GENERIC;
-#endif // defined(OS_IOS)
}
// static
-std::string CreditCard::GetCreditCardType(const base::string16& number) {
+const char* CreditCard::GetCreditCardType(const base::string16& number) {
// Credit card number specifications taken from:
// http://en.wikipedia.org/wiki/Credit_card_numbers,
// http://en.wikipedia.org/wiki/List_of_Issuer_Identification_Numbers,