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

Unified Diff: chrome/browser/autofill/form_field.h

Issue 7063031: Heuristics for grabber-continental.com.out (select-one) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove debugging and MONTH. Created 9 years, 7 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: chrome/browser/autofill/form_field.h
diff --git a/chrome/browser/autofill/form_field.h b/chrome/browser/autofill/form_field.h
index db00e9e7f9efa9951937324cd5c462551d5d7a99..805493f3b1012d825c271503490585017def2aa7 100644
--- a/chrome/browser/autofill/form_field.h
+++ b/chrome/browser/autofill/form_field.h
@@ -32,9 +32,20 @@ class FormField {
protected:
// A bit-field used for matching specific parts of a field in question.
enum MatchType {
- MATCH_LABEL = 1 << 0,
- MATCH_NAME = 1 << 1,
- MATCH_ALL = MATCH_LABEL | MATCH_NAME
+ // Attributes.
+ MATCH_LABEL = 1 << 0,
+ MATCH_NAME = 1 << 1,
+
+ // Input types.
+ MATCH_TEXT = 1 << 2,
+ MATCH_EMAIL = 1 << 3,
+ MATCH_TELEPHONE = 1 << 4,
+ MATCH_SELECT = 1 << 5,
+ MATCH_ALL_INPUTS =
+ MATCH_TEXT | MATCH_EMAIL | MATCH_TELEPHONE | MATCH_SELECT,
+
+ // By default match label, name, for input/text types.
Ilya Sherman 2011/05/25 19:17:28 nit: "label, name, for" -> "label and name for"
dhollowa 2011/05/25 21:55:42 Done.
+ MATCH_DEFAULT = MATCH_LABEL | MATCH_NAME | MATCH_TEXT,
};
// Only derived classes may instantiate.
@@ -75,6 +86,15 @@ class FormField {
private:
FRIEND_TEST_ALL_PREFIXES(FormFieldTest, Match);
+ // Matches |pattern| to the contents of the field at the head of the
+ // |scanner|.
+ // Returns |true| if a match is found according to |match_type|, and |false|
+ // otherwise.
+ static bool MatchAndAdvance(AutofillScanner* scanner,
+ const string16& pattern,
+ int match_type,
+ const AutofillField** match);
+
// Matches the regular expression |pattern| against the components of |field|
// as specified in the |match_type| bit field (see |MatchType|).
static bool Match(const AutofillField* field,

Powered by Google App Engine
This is Rietveld 408576698