Chromium Code Reviews| Index: chrome/browser/autofill/name_field.h |
| diff --git a/chrome/browser/autofill/name_field.h b/chrome/browser/autofill/name_field.h |
| index 307b0760158c6d5a1b4e426020ab2a0f0308b12a..96228b58980d7d4e5bee77be80e8aef54376e7e6 100644 |
| --- a/chrome/browser/autofill/name_field.h |
| +++ b/chrome/browser/autofill/name_field.h |
| @@ -9,6 +9,7 @@ |
| #include <vector> |
| #include "base/compiler_specific.h" |
| +#include "base/gtest_prod_util.h" |
| #include "chrome/browser/autofill/autofill_field.h" |
| #include "chrome/browser/autofill/form_field.h" |
| @@ -23,19 +24,34 @@ class NameField : public FormField { |
| NameField() {} |
| private: |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); |
| + FRIEND_TEST_ALL_PREFIXES(NameFieldTest, ECMLFirstMiddleLast); |
| + |
| + // FormField: |
| + virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE { return false; } |
| + |
| DISALLOW_COPY_AND_ASSIGN(NameField); |
| }; |
| // A form field that can parse a full name field. |
| class FullNameField : public NameField { |
|
Ilya Sherman
2011/05/19 05:44:16
Should this class and also FirstLastNameField be m
dhollowa
2011/05/19 17:53:08
Yes. Done.
|
| public: |
| - virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const OVERRIDE; |
| - |
| static FullNameField* Parse(AutofillScanner* scanner); |
| private: |
| explicit FullNameField(const AutofillField* field); |
| + // FormField interface: |
| + virtual bool ClassifyField(FieldTypeMap* field_type_map) const OVERRIDE; |
| + |
| const AutofillField* field_; |
| DISALLOW_COPY_AND_ASSIGN(FullNameField); |
| }; |
| @@ -43,8 +59,6 @@ class FullNameField : public NameField { |
| // A form field that can parse a first and last name field. |
| class FirstLastNameField : public NameField { |
| public: |
| - virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const OVERRIDE; |
| - |
| static FirstLastNameField* ParseSpecificName(AutofillScanner* scanner); |
| static FirstLastNameField* ParseComponentNames(AutofillScanner* scanner); |
| static FirstLastNameField* ParseEcmlName(AutofillScanner* scanner); |
| @@ -53,6 +67,9 @@ class FirstLastNameField : public NameField { |
| private: |
| FirstLastNameField(); |
| + // FormField interface: |
| + virtual bool ClassifyField(FieldTypeMap* field_type_map) const OVERRIDE; |
| + |
| const AutofillField* first_name_; |
| const AutofillField* middle_name_; // Optional. |
| const AutofillField* last_name_; |