| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ | 6 #define CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "chrome/browser/autofill/autofill_field.h" | 13 #include "chrome/browser/autofill/autofill_field.h" |
| 14 #include "chrome/browser/autofill/form_field.h" | 14 #include "chrome/browser/autofill/form_field.h" |
| 15 | 15 |
| 16 class AutofillScanner; | 16 class AutofillScanner; |
| 17 | 17 |
| 18 // A form field that can parse either a FullNameField or a FirstLastNameField. | 18 // A form field that can parse either a FullNameField or a FirstLastNameField. |
| 19 class NameField : public FormField { | 19 class NameField : public FormField { |
| 20 public: | 20 public: |
| 21 static FormField* Parse(AutofillScanner* scanner, bool is_ecml); | 21 static FormField* Parse(AutofillScanner* scanner); |
| 22 | 22 |
| 23 protected: | 23 protected: |
| 24 NameField() {} | 24 NameField() {} |
| 25 | 25 |
| 26 // FormField: | 26 // FormField: |
| 27 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE; | 27 virtual bool ClassifyField(FieldTypeMap* map) const OVERRIDE; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); | 30 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast); |
| 31 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); | 31 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLast2); |
| 32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); | 32 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast); |
| 33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); | 33 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLast2); |
| 34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); | 34 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastMiddleWithSpaces); |
| 35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); | 35 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstLastEmpty); |
| 36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); | 36 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, FirstMiddleLastEmpty); |
| 37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); | 37 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitial); |
| 38 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); | 38 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, MiddleInitialAtEnd); |
| 39 FRIEND_TEST_ALL_PREFIXES(NameFieldTest, ECMLFirstMiddleLast); | |
| 40 | 39 |
| 41 DISALLOW_COPY_AND_ASSIGN(NameField); | 40 DISALLOW_COPY_AND_ASSIGN(NameField); |
| 42 }; | 41 }; |
| 43 | 42 |
| 44 #endif // CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ | 43 #endif // CHROME_BROWSER_AUTOFILL_NAME_FIELD_H_ |
| OLD | NEW |