| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "components/autofill/core/browser/autofill_type.h" | 15 #include "components/autofill/core/browser/autofill_type.h" |
| 16 #include "components/autofill/core/browser/form_field.h" | 16 #include "components/autofill/core/browser/form_field.h" |
| 17 | 17 |
| 18 namespace autofill { | 18 namespace autofill { |
| 19 | 19 |
| 20 class AutofillField; | 20 class AutofillField; |
| 21 class AutofillScanner; | 21 class AutofillScanner; |
| 22 | 22 |
| 23 class AddressField : public FormField { | 23 class AddressField : public FormField { |
| 24 public: | 24 public: |
| 25 static scoped_ptr<FormField> Parse(AutofillScanner* scanner); | 25 static std::unique_ptr<FormField> Parse(AutofillScanner* scanner); |
| 26 | 26 |
| 27 protected: | 27 protected: |
| 28 void AddClassifications(FieldCandidatesMap* field_candidates) const override; | 28 void AddClassifications(FieldCandidatesMap* field_candidates) const override; |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 // When parsing a field's label and name separately with a given pattern: | 31 // When parsing a field's label and name separately with a given pattern: |
| 32 enum ParseNameLabelResult { | 32 enum ParseNameLabelResult { |
| 33 RESULT_MATCH_NONE, // No match with the label or name. | 33 RESULT_MATCH_NONE, // No match with the label or name. |
| 34 RESULT_MATCH_LABEL, // Only the label matches the pattern. | 34 RESULT_MATCH_LABEL, // Only the label matches the pattern. |
| 35 RESULT_MATCH_NAME, // Only the name matches the pattern. | 35 RESULT_MATCH_NAME, // Only the name matches the pattern. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 AutofillField* zip_; | 93 AutofillField* zip_; |
| 94 AutofillField* zip4_; // optional ZIP+4; we don't fill this yet. | 94 AutofillField* zip4_; // optional ZIP+4; we don't fill this yet. |
| 95 AutofillField* country_; | 95 AutofillField* country_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(AddressField); | 97 DISALLOW_COPY_AND_ASSIGN(AddressField); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace autofill | 100 } // namespace autofill |
| 101 | 101 |
| 102 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ | 102 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_FIELD_H_ |
| OLD | NEW |