OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_ |
6 #define CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_ | 6 #define CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Returns a clone of this object. | 22 // Returns a clone of this object. |
23 virtual FormGroup* Clone() const = 0; | 23 virtual FormGroup* Clone() const = 0; |
24 | 24 |
25 // Used to determine the type of a field based on the text that a user enters | 25 // Used to determine the type of a field based on the text that a user enters |
26 // into the field. The field types can then be reported back to the server. | 26 // into the field. The field types can then be reported back to the server. |
27 // This method is additive on |possible_types|. | 27 // This method is additive on |possible_types|. |
28 virtual void GetPossibleFieldTypes(const string16& text, | 28 virtual void GetPossibleFieldTypes(const string16& text, |
29 FieldTypeSet* possible_types) const = 0; | 29 FieldTypeSet* possible_types) const = 0; |
30 | 30 |
31 // Returns the string that should be autofilled into a text field given the | 31 // Returns a set of AutoFillFieldTypes for which this FormGroup has non-empty |
| 32 // data. |
| 33 virtual void GetAvailableFieldTypes(FieldTypeSet* available_types) const = 0; |
| 34 |
| 35 // Returns the string that should be auto-filled into a text field given the |
32 // type of that field. | 36 // type of that field. |
33 virtual string16 GetFieldText(const AutoFillType& type) const = 0; | 37 virtual string16 GetFieldText(const AutoFillType& type) const = 0; |
34 | 38 |
35 // Returns the text for preview. | 39 // Returns the text for preview. |
36 virtual string16 GetPreviewText(const AutoFillType& type) const { | 40 virtual string16 GetPreviewText(const AutoFillType& type) const { |
37 return GetFieldText(type); | 41 return GetFieldText(type); |
38 } | 42 } |
39 | 43 |
40 // Used to determine if the text being typed into a field matches the | 44 // Used to determine if the text being typed into a field matches the |
41 // information in this FormGroup object. This is used by the preview | 45 // information in this FormGroup object. This is used by the preview |
42 // functionality. |matched_text| will be populated with all of the possible | 46 // functionality. |matched_text| will be populated with all of the possible |
43 // matches given the type. This method is additive on |matched_text|. | 47 // matches given the type. This method is additive on |matched_text|. |
44 virtual void FindInfoMatches(const AutoFillType& type, | 48 virtual void FindInfoMatches(const AutoFillType& type, |
45 const string16& info, | 49 const string16& info, |
46 std::vector<string16>* matched_text) const = 0; | 50 std::vector<string16>* matched_text) const = 0; |
47 | 51 |
48 // Used to populate this FormGroup object with data. | 52 // Used to populate this FormGroup object with data. |
49 virtual void SetInfo(const AutoFillType& type, const string16& value) = 0; | 53 virtual void SetInfo(const AutoFillType& type, const string16& value) = 0; |
50 | 54 |
51 // Returns the label for this FormGroup item. This should be overridden for | 55 // Returns the label for this FormGroup item. This should be overridden for |
52 // form group items that implement a label. | 56 // form group items that implement a label. |
53 virtual const string16& Label() const { return EmptyString16(); } | 57 virtual const string16& Label() const { return EmptyString16(); } |
54 }; | 58 }; |
55 | 59 |
56 #endif // CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_ | 60 #endif // CHROME_BROWSER_AUTOFILL_FORM_GROUP_H_ |
OLD | NEW |