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

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

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/autofill_field.cc
diff --git a/components/autofill/core/browser/autofill_field.cc b/components/autofill/core/browser/autofill_field.cc
index c2a744203af2321856cbc617e84fece0c7a1c114..c5b696e933c2721bda73b265aeddc2e89b5d1a89 100644
--- a/components/autofill/core/browser/autofill_field.cc
+++ b/components/autofill/core/browser/autofill_field.cc
@@ -43,7 +43,7 @@ const char* const kMonthsFull[] = {
// the list of select options in |field|.
bool SetSelectControlValue(const base::string16& value,
FormFieldData* field) {
- base::string16 value_lowercase = StringToLowerASCII(value);
+ base::string16 value_lowercase = base::StringToLowerASCII(value);
DCHECK_EQ(field->option_values.size(), field->option_contents.size());
base::string16 best_match;
@@ -55,8 +55,9 @@ bool SetSelectControlValue(const base::string16& value,
break;
}
- if (value_lowercase == StringToLowerASCII(field->option_values[i]) ||
- value_lowercase == StringToLowerASCII(field->option_contents[i])) {
+ if (value_lowercase == base::StringToLowerASCII(field->option_values[i]) ||
+ value_lowercase ==
+ base::StringToLowerASCII(field->option_contents[i])) {
// A match, but not in the same case. Save it in case an exact match is
// not found.
best_match = field->option_values[i];
@@ -74,15 +75,15 @@ bool SetSelectControlValue(const base::string16& value,
// for |value|. For example, "NC - North Carolina" would match "north carolina".
bool SetSelectControlValueSubstringMatch(const base::string16& value,
FormFieldData* field) {
- base::string16 value_lowercase = StringToLowerASCII(value);
+ base::string16 value_lowercase = base::StringToLowerASCII(value);
DCHECK_EQ(field->option_values.size(), field->option_contents.size());
int best_match = -1;
for (size_t i = 0; i < field->option_values.size(); ++i) {
- if (StringToLowerASCII(field->option_values[i]).find(value_lowercase) !=
+ if (base::StringToLowerASCII(field->option_values[i]).find(value_lowercase) !=
std::string::npos ||
- StringToLowerASCII(field->option_contents[i]).find(value_lowercase) !=
- std::string::npos) {
+ base::StringToLowerASCII(field->option_contents[i]).find(
+ value_lowercase) != std::string::npos) {
// The best match is the shortest one.
if (best_match == -1 ||
field->option_values[best_match].size() >
@@ -105,13 +106,13 @@ bool SetSelectControlValueSubstringMatch(const base::string16& value,
// tokens. For example, "NC - North Carolina" would match "nc" but not "ca".
bool SetSelectControlValueTokenMatch(const base::string16& value,
FormFieldData* field) {
- base::string16 value_lowercase = StringToLowerASCII(value);
+ base::string16 value_lowercase = base::StringToLowerASCII(value);
std::vector<base::string16> tokenized;
DCHECK_EQ(field->option_values.size(), field->option_contents.size());
for (size_t i = 0; i < field->option_values.size(); ++i) {
base::SplitStringAlongWhitespace(
- StringToLowerASCII(field->option_values[i]), &tokenized);
+ base::StringToLowerASCII(field->option_values[i]), &tokenized);
if (std::find(tokenized.begin(), tokenized.end(), value_lowercase) !=
tokenized.end()) {
field->value = field->option_values[i];
@@ -119,7 +120,7 @@ bool SetSelectControlValueTokenMatch(const base::string16& value,
}
base::SplitStringAlongWhitespace(
- StringToLowerASCII(field->option_contents[i]), &tokenized);
+ base::StringToLowerASCII(field->option_contents[i]), &tokenized);
if (std::find(tokenized.begin(), tokenized.end(), value_lowercase) !=
tokenized.end()) {
field->value = field->option_values[i];
@@ -246,15 +247,15 @@ bool FillCreditCardTypeSelectControl(const base::string16& value,
FormFieldData* field) {
// Try stripping off spaces.
base::string16 value_stripped;
- base::RemoveChars(StringToLowerASCII(value), base::kWhitespaceUTF16,
+ base::RemoveChars(base::StringToLowerASCII(value), base::kWhitespaceUTF16,
&value_stripped);
for (size_t i = 0; i < field->option_values.size(); ++i) {
base::string16 option_value_lowercase;
- base::RemoveChars(StringToLowerASCII(field->option_values[i]),
+ base::RemoveChars(base::StringToLowerASCII(field->option_values[i]),
base::kWhitespaceUTF16, &option_value_lowercase);
base::string16 option_contents_lowercase;
- base::RemoveChars(StringToLowerASCII(field->option_contents[i]),
+ base::RemoveChars(base::StringToLowerASCII(field->option_contents[i]),
base::kWhitespaceUTF16, &option_contents_lowercase);
// Perform a case-insensitive comparison; but fill the form with the
« no previous file with comments | « components/autofill/content/browser/wallet/required_action.cc ('k') | components/autofill/core/browser/autofill_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698