Chromium Code Reviews| Index: components/autofill/core/browser/form_field.h |
| diff --git a/components/autofill/core/browser/form_field.h b/components/autofill/core/browser/form_field.h |
| index e1f4d36b7a138f818f87d282f2b0c40234aeba32..d4e3c20f863360e218ad15c7a7075c98e351b959 100644 |
| --- a/components/autofill/core/browser/form_field.h |
| +++ b/components/autofill/core/browser/form_field.h |
| @@ -55,6 +55,13 @@ class FormField { |
| MATCH_DEFAULT = MATCH_LABEL | MATCH_NAME | MATCH_TEXT, |
| }; |
| + enum ParseNameLabelResult { |
|
Evan Stade
2015/03/24 00:04:32
docs
Lei Zhang
2015/03/25 00:42:28
Done.
|
| + RESULT_MATCH_NONE, |
| + RESULT_MATCH_LABEL, |
| + RESULT_MATCH_NAME, |
| + RESULT_MATCH_NAME_LABEL |
| + }; |
| + |
| // Only derived classes may instantiate. |
| FormField() {} |
| @@ -74,6 +81,17 @@ class FormField { |
| int match_type, |
| AutofillField** match); |
| + // Like ParseFieldSpecifics(), but applies |pattern| against the name and |
| + // label of the current field separately. If the return value is |
| + // RESULT_MATCH_NAME_LABEL, then |scanner| advances and |match| is filled if |
| + // it is non-NULL. Otherwise |scanner| does not advance and |match| does not |
| + // change. |
| + static ParseNameLabelResult ParseNameAndLabelSeparately( |
| + AutofillScanner* scanner, |
| + const base::string16& pattern, |
| + int match_type, |
| + AutofillField** match); |
| + |
| // Attempts to parse a field with an empty label. Returns true |
| // on success and fills |match| with a pointer to the field. |
| static bool ParseEmptyLabel(AutofillScanner* scanner, AutofillField** match); |
| @@ -114,6 +132,10 @@ class FormField { |
| const base::string16& pattern, |
| int match_type); |
| + // Returns |match_type| sans MATCH_LABEL/MATCH_NAME. |
| + static int MatchTypeWithoutLabel(int match_type); |
| + static int MatchTypeWithoutName(int match_type); |
| + |
| // Perform a "pass" over the |fields| where each pass uses the supplied |
| // |parse| method to match content to a given field type. |
| // |fields| is both an input and an output parameter. Upon exit |fields| |