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_FORM_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_FIELD_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_FIELD_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // interface can identify themselves as a particular type of form field, e.g. | 22 // interface can identify themselves as a particular type of form field, e.g. |
23 // name, phone number, or address field. | 23 // name, phone number, or address field. |
24 class FormField { | 24 class FormField { |
25 public: | 25 public: |
26 virtual ~FormField() {} | 26 virtual ~FormField() {} |
27 | 27 |
28 // Classifies each field in |fields| with its heuristically detected type. | 28 // Classifies each field in |fields| with its heuristically detected type. |
29 // The association is stored into |map|. Each field has a derived unique name | 29 // The association is stored into |map|. Each field has a derived unique name |
30 // that is used as the key into the |map|. | 30 // that is used as the key into the |map|. |
31 static void ParseFormFields(const std::vector<AutofillField*>& fields, | 31 static void ParseFormFields(const std::vector<AutofillField*>& fields, |
| 32 bool is_form_tag, |
32 ServerFieldTypeMap* map); | 33 ServerFieldTypeMap* map); |
33 | 34 |
34 protected: | 35 protected: |
35 // A bit-field used for matching specific parts of a field in question. | 36 // A bit-field used for matching specific parts of a field in question. |
36 enum MatchType { | 37 enum MatchType { |
37 // Attributes. | 38 // Attributes. |
38 MATCH_LABEL = 1 << 0, | 39 MATCH_LABEL = 1 << 0, |
39 MATCH_NAME = 1 << 1, | 40 MATCH_NAME = 1 << 1, |
40 MATCH_VALUE = 1 << 2, | 41 MATCH_VALUE = 1 << 2, |
41 | 42 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 122 |
122 // Returns true iff |type| matches |match_type|. | 123 // Returns true iff |type| matches |match_type|. |
123 static bool MatchesFormControlType(const std::string& type, int match_type); | 124 static bool MatchesFormControlType(const std::string& type, int match_type); |
124 | 125 |
125 DISALLOW_COPY_AND_ASSIGN(FormField); | 126 DISALLOW_COPY_AND_ASSIGN(FormField); |
126 }; | 127 }; |
127 | 128 |
128 } // namespace autofill | 129 } // namespace autofill |
129 | 130 |
130 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_FIELD_H_ | 131 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_FORM_FIELD_H_ |
OLD | NEW |