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

Side by Side Diff: components/autofill/core/browser/form_field.h

Issue 853523004: Autofill: Set requirements for number of recognized fields in an autofillable form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, change variable name Created 5 years, 10 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 unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698