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

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

Issue 7043027: Autofill refactor form_field.h/cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OVERRIDE glitch. 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
« no previous file with comments | « chrome/browser/autofill/form_field_unittest.cc ('k') | chrome/browser/autofill/name_field.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..69f037ca1424a079bc210f7bc08d729641d801d2 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"
@@ -22,43 +23,22 @@ class NameField : public FormField {
protected:
NameField() {}
- private:
- DISALLOW_COPY_AND_ASSIGN(NameField);
-};
-
-// A form field that can parse a full name field.
-class FullNameField : public NameField {
- public:
- virtual bool GetFieldInfo(FieldTypeMap* field_type_map) const OVERRIDE;
-
- static FullNameField* Parse(AutofillScanner* scanner);
+ // FormField:
+ virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE;
private:
- explicit FullNameField(const AutofillField* field);
-
- const AutofillField* field_;
- DISALLOW_COPY_AND_ASSIGN(FullNameField);
-};
+ 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);
-// 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);
- static FirstLastNameField* Parse(AutofillScanner* scanner, bool is_ecml);
-
- private:
- FirstLastNameField();
-
- const AutofillField* first_name_;
- const AutofillField* middle_name_; // Optional.
- const AutofillField* last_name_;
- bool middle_initial_; // True if middle_name_ is a middle initial.
-
- DISALLOW_COPY_AND_ASSIGN(FirstLastNameField);
+ DISALLOW_COPY_AND_ASSIGN(NameField);
};
#endif // CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_
« no previous file with comments | « chrome/browser/autofill/form_field_unittest.cc ('k') | chrome/browser/autofill/name_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698