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

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

Issue 1518783002: Revert of autofill: switch autofill_regexes to RE2 library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/form_field.cc
diff --git a/components/autofill/core/browser/form_field.cc b/components/autofill/core/browser/form_field.cc
index 69a3771234b9cbd00bb6dd7b21c29a4ff6c33b2d..50d7e8a30a81cf74343e3656627695840085f9cf 100644
--- a/components/autofill/core/browser/form_field.cc
+++ b/components/autofill/core/browser/form_field.cc
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/address_field.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_scanner.h"
@@ -83,14 +84,14 @@
// static
bool FormField::ParseField(AutofillScanner* scanner,
- const std::string& pattern,
+ const base::string16& pattern,
AutofillField** match) {
return ParseFieldSpecifics(scanner, pattern, MATCH_DEFAULT, match);
}
// static
bool FormField::ParseFieldSpecifics(AutofillScanner* scanner,
- const std::string& pattern,
+ const base::string16& pattern,
int match_type,
AutofillField** match) {
if (scanner->IsEnd())
@@ -107,7 +108,7 @@
// static
FormField::ParseNameLabelResult FormField::ParseNameAndLabelSeparately(
AutofillScanner* scanner,
- const std::string& pattern,
+ const base::string16& pattern,
int match_type,
AutofillField** match) {
if (scanner->IsEnd())
@@ -142,7 +143,7 @@
bool FormField::ParseEmptyLabel(AutofillScanner* scanner,
AutofillField** match) {
return ParseFieldSpecifics(scanner,
- "^$",
+ base::ASCIIToUTF16("^$"),
MATCH_LABEL | MATCH_ALL_INPUTS,
match);
}
@@ -160,7 +161,7 @@
// static.
bool FormField::MatchAndAdvance(AutofillScanner* scanner,
- const std::string& pattern,
+ const base::string16& pattern,
int match_type,
AutofillField** match) {
AutofillField* field = scanner->Cursor();
@@ -176,7 +177,7 @@
// static
bool FormField::Match(const AutofillField* field,
- const std::string& pattern,
+ const base::string16& pattern,
int match_type) {
if ((match_type & FormField::MATCH_LABEL) &&
MatchesPattern(field->label, pattern)) {
« no previous file with comments | « components/autofill/core/browser/form_field.h ('k') | components/autofill/core/browser/form_field_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698