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

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

Issue 1074343004: get rid of another inappropriate ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nodeleteallowed
Patch Set: Created 5 years, 8 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
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 85bad41ffd98eca579d1f5e42657e5b029d2f539..346d22b57980b5ff9813ccecd9cf6264fc958255 100644
--- a/components/autofill/core/browser/credit_card.cc
+++ b/components/autofill/core/browser/credit_card.cc
@@ -23,6 +23,7 @@
#include "components/autofill/core/browser/autofill_regexes.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/validation.h"
+#include "components/autofill/core/common/autofill_l10n_util.h"
#include "components/autofill/core/common/form_field_data.h"
#include "grit/components_scaled_resources.h"
#include "grit/components_strings.h"
@@ -70,8 +71,7 @@ bool ConvertMonth(const base::string16& month,
// Otherwise, try parsing the |month| as a named month, e.g. "January" or
// "Jan".
- base::string16 lowercased_month = base::StringToLowerASCII(month);
-
+ l10n::CaseInsensitiveCompare compare;
UErrorCode status = U_ZERO_ERROR;
icu::Locale locale(app_locale.c_str());
icu::DateFormatSymbols date_format_symbols(locale, status);
@@ -81,9 +81,8 @@ bool ConvertMonth(const base::string16& month,
int32_t num_months;
const icu::UnicodeString* months = date_format_symbols.getMonths(num_months);
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 == base::StringToLowerASCII(icu_month)) {
+ const base::string16 icu_month(months[i].getBuffer(), months[i].length());
+ if (compare.StringsEqual(icu_month, month)) {
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
return true;
}
@@ -91,9 +90,8 @@ bool ConvertMonth(const base::string16& month,
months = date_format_symbols.getShortMonths(num_months);
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 == base::StringToLowerASCII(icu_month)) {
+ const base::string16 icu_month(months[i].getBuffer(), months[i].length());
+ if (compare.StringsEqual(icu_month, month)) {
*num = i + 1; // Adjust from 0-indexed to 1-indexed.
return true;
}
« no previous file with comments | « components/autofill/core/browser/autofill_popup_delegate.h ('k') | components/autofill/core/browser/credit_card_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698