Index: chrome/browser/autofill/form_field.h |
diff --git a/chrome/browser/autofill/form_field.h b/chrome/browser/autofill/form_field.h |
index 3bb5c0eca47528862efea72e7ff0e44fb250544f..17aa969028e368a9f93f3fd5d6f9e526881bbc29 100644 |
--- a/chrome/browser/autofill/form_field.h |
+++ b/chrome/browser/autofill/form_field.h |
@@ -79,18 +79,28 @@ class FormField { |
const string16& pattern, |
bool match_label_only); |
+ enum MatchType { |
+ MATCH_LABEL = 1 << 0, |
+ MATCH_NAME = 1 << 1, |
+ MATCH_TEXT = 1 << 2, |
+ MATCH_SELECT = 1 << 3, |
+ }; |
+ |
// Parses a field using the different field views we know about. |is_ecml| |
// should be true when the field conforms to the ECML specification. |
static FormField* ParseFormField(AutofillScanner* scanner, bool is_ecml); |
// Attempts to parse a text field with the given pattern; returns true on |
// success, but doesn't return the actual text field itself. |
- static bool ParseText(AutofillScanner* scanner, const string16& pattern); |
+ static bool ParseText(AutofillScanner* scanner, |
+ const string16& pattern, |
+ int match_type); |
// Attempts to parse a text field with the given pattern. Returns true on |
// success and fills |dest| with a pointer to the field. |
static bool ParseText(AutofillScanner* scanner, |
const string16& pattern, |
+ int match_type, |
const AutofillField** dest); |
// Attempts to parse a text field with an empty name or label. Returns true |
@@ -98,12 +108,6 @@ class FormField { |
static bool ParseEmptyText(AutofillScanner* scanner, |
const AutofillField** dest); |
- // Attempts to parse a text field label with the given pattern. Returns true |
- // on success and fills |dest| with a pointer to the field. |
- static bool ParseLabelText(AutofillScanner* scanner, |
- const string16& pattern, |
- const AutofillField** dest); |
- |
// Attempts to parse a control with an empty label. |
static bool ParseEmpty(AutofillScanner* scanner); |
@@ -132,12 +136,8 @@ class FormField { |
static bool ParseText(AutofillScanner* scanner, |
const string16& pattern, |
const AutofillField** dest, |
- bool match_label_only); |
+ int match_type); |
- // For empty strings we need to test that both label and name are empty. |
- static bool ParseLabelAndName(AutofillScanner* scanner, |
- const string16& pattern, |
- const AutofillField** dest); |
static bool MatchName(const AutofillField* field, const string16& pattern); |
static bool MatchLabel(const AutofillField* field, const string16& pattern); |