| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "components/autofill/core/browser/name_field.h" | 5 #include "components/autofill/core/browser/name_field.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "components/autofill/core/browser/autofill_regex_constants.h" | |
| 14 #include "components/autofill/core/browser/autofill_scanner.h" | 13 #include "components/autofill/core/browser/autofill_scanner.h" |
| 15 #include "components/autofill/core/browser/autofill_type.h" | 14 #include "components/autofill/core/browser/autofill_type.h" |
| 15 #include "components/autofill/core/common/autofill_regex_constants.h" |
| 16 | 16 |
| 17 using base::UTF8ToUTF16; | 17 using base::UTF8ToUTF16; |
| 18 | 18 |
| 19 namespace autofill { | 19 namespace autofill { |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // A form field that can parse a full name field. | 22 // A form field that can parse a full name field. |
| 23 class FullNameField : public NameField { | 23 class FullNameField : public NameField { |
| 24 public: | 24 public: |
| 25 static std::unique_ptr<FullNameField> Parse(AutofillScanner* scanner); | 25 static std::unique_ptr<FullNameField> Parse(AutofillScanner* scanner); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 AddClassification(first_name_, NAME_FIRST, kBaseNameParserScore, | 212 AddClassification(first_name_, NAME_FIRST, kBaseNameParserScore, |
| 213 field_candidates); | 213 field_candidates); |
| 214 AddClassification(last_name_, NAME_LAST, kBaseNameParserScore, | 214 AddClassification(last_name_, NAME_LAST, kBaseNameParserScore, |
| 215 field_candidates); | 215 field_candidates); |
| 216 const ServerFieldType type = | 216 const ServerFieldType type = |
| 217 middle_initial_ ? NAME_MIDDLE_INITIAL : NAME_MIDDLE; | 217 middle_initial_ ? NAME_MIDDLE_INITIAL : NAME_MIDDLE; |
| 218 AddClassification(middle_name_, type, kBaseNameParserScore, field_candidates); | 218 AddClassification(middle_name_, type, kBaseNameParserScore, field_candidates); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace autofill | 221 } // namespace autofill |
| OLD | NEW |