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_AUTOFILL_FIELD_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "components/autofill/core/browser/field_types.h" | 14 #include "components/autofill/core/browser/field_types.h" |
15 #include "components/autofill/core/browser/proto/server.pb.h" | 15 #include "components/autofill/core/browser/proto/server.pb.h" |
16 #include "components/autofill/core/common/form_field_data.h" | 16 #include "components/autofill/core/common/form_field_data.h" |
| 17 #include "components/autofill/core/common/signatures_util.h" |
17 | 18 |
18 namespace autofill { | 19 namespace autofill { |
19 | 20 |
20 class AutofillType; | 21 class AutofillType; |
21 | 22 |
22 class AutofillField : public FormFieldData { | 23 class AutofillField : public FormFieldData { |
23 public: | 24 public: |
24 enum PhonePart { | 25 enum PhonePart { |
25 IGNORED = 0, | 26 IGNORED = 0, |
26 PHONE_PREFIX = 1, | 27 PHONE_PREFIX = 1, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 61 |
61 // This function automatically chooses between server and heuristic autofill | 62 // This function automatically chooses between server and heuristic autofill |
62 // type, depending on the data available. | 63 // type, depending on the data available. |
63 AutofillType Type() const; | 64 AutofillType Type() const; |
64 | 65 |
65 // Returns true if the value of this field is empty. | 66 // Returns true if the value of this field is empty. |
66 bool IsEmpty() const; | 67 bool IsEmpty() const; |
67 | 68 |
68 // The unique signature of this field, composed of the field name and the html | 69 // The unique signature of this field, composed of the field name and the html |
69 // input type in a 32-bit hash. | 70 // input type in a 32-bit hash. |
70 std::string FieldSignature() const; | 71 FieldSignature FieldSignature() const; |
| 72 |
| 73 // Returns the field signature as string. |
| 74 std::string FieldSignatureAsStr() const; |
71 | 75 |
72 // Returns true if the field type has been determined (without the text in the | 76 // Returns true if the field type has been determined (without the text in the |
73 // field). | 77 // field). |
74 bool IsFieldFillable() const; | 78 bool IsFieldFillable() const; |
75 | 79 |
76 void set_default_value(const std::string& value) { default_value_ = value; } | 80 void set_default_value(const std::string& value) { default_value_ = value; } |
77 const std::string& default_value() const { return default_value_; } | 81 const std::string& default_value() const { return default_value_; } |
78 | 82 |
79 void set_credit_card_number_offset(size_t position) { | 83 void set_credit_card_number_offset(size_t position) { |
80 credit_card_number_offset_ = position; | 84 credit_card_number_offset_ = position; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 178 |
175 // The outcome of HTML parsing based form classifier. | 179 // The outcome of HTML parsing based form classifier. |
176 AutofillUploadContents::Field::FormClassifierOutcome form_classifier_outcome_; | 180 AutofillUploadContents::Field::FormClassifierOutcome form_classifier_outcome_; |
177 | 181 |
178 DISALLOW_COPY_AND_ASSIGN(AutofillField); | 182 DISALLOW_COPY_AND_ASSIGN(AutofillField); |
179 }; | 183 }; |
180 | 184 |
181 } // namespace autofill | 185 } // namespace autofill |
182 | 186 |
183 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ | 187 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_FIELD_H_ |
OLD | NEW |