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 CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 virtual bool SectionIsActive(DialogSection section) const = 0; | 97 virtual bool SectionIsActive(DialogSection section) const = 0; |
98 | 98 |
99 // Returns the set of inputs the page has requested which fall under | 99 // Returns the set of inputs the page has requested which fall under |
100 // |section|. | 100 // |section|. |
101 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) | 101 virtual const DetailInputs& RequestedFieldsForSection(DialogSection section) |
102 const = 0; | 102 const = 0; |
103 | 103 |
104 // Returns the combobox model for inputs of type |type|, or NULL if the input | 104 // Returns the combobox model for inputs of type |type|, or NULL if the input |
105 // should be a text field. | 105 // should be a text field. |
106 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 106 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
107 AutofillFieldType type) = 0; | 107 ServerFieldType type) = 0; |
108 | 108 |
109 // Returns the model for suggestions for fields that fall under |section|. | 109 // Returns the model for suggestions for fields that fall under |section|. |
110 // This may return NULL, in which case no menu should be shown for that | 110 // This may return NULL, in which case no menu should be shown for that |
111 // section. | 111 // section. |
112 virtual ui::MenuModel* MenuModelForSection(DialogSection section) = 0; | 112 virtual ui::MenuModel* MenuModelForSection(DialogSection section) = 0; |
113 | 113 |
114 // Returns the label text used to describe the section (i.e. Billing). | 114 // Returns the label text used to describe the section (i.e. Billing). |
115 virtual string16 LabelForSection(DialogSection section) const = 0; | 115 virtual string16 LabelForSection(DialogSection section) const = 0; |
116 | 116 |
117 // Returns the current state of suggestions for |section|. | 117 // Returns the current state of suggestions for |section|. |
118 virtual SuggestionState SuggestionStateForSection(DialogSection section) = 0; | 118 virtual SuggestionState SuggestionStateForSection(DialogSection section) = 0; |
119 | 119 |
120 // Should be called when the user starts editing of the section. | 120 // Should be called when the user starts editing of the section. |
121 virtual void EditClickedForSection(DialogSection section) = 0; | 121 virtual void EditClickedForSection(DialogSection section) = 0; |
122 | 122 |
123 // Should be called when the user cancels editing of the section. | 123 // Should be called when the user cancels editing of the section. |
124 virtual void EditCancelledForSection(DialogSection section) = 0; | 124 virtual void EditCancelledForSection(DialogSection section) = 0; |
125 | 125 |
126 // Returns an icon to be displayed along with the input for the given type. | 126 // Returns an icon to be displayed along with the input for the given type. |
127 // |user_input| is the current text in the textfield. | 127 // |user_input| is the current text in the textfield. |
128 virtual gfx::Image IconForField(AutofillFieldType type, | 128 virtual gfx::Image IconForField(ServerFieldType type, |
129 const string16& user_input) const = 0; | 129 const string16& user_input) const = 0; |
130 | 130 |
131 // Decides whether input of |value| is valid for a field of type |type|. If | 131 // Decides whether input of |value| is valid for a field of type |type|. If |
132 // valid, the returned string will be empty. Otherwise it will contain an | 132 // valid, the returned string will be empty. Otherwise it will contain an |
133 // error message. | 133 // error message. |
134 virtual string16 InputValidityMessage(DialogSection section, | 134 virtual string16 InputValidityMessage(DialogSection section, |
135 AutofillFieldType type, | 135 ServerFieldType type, |
136 const string16& value) = 0; | 136 const string16& value) = 0; |
137 | 137 |
138 | 138 |
139 // Decides whether the combination of all |inputs| is valid, returns a | 139 // Decides whether the combination of all |inputs| is valid, returns a |
140 // map of field types to error strings. | 140 // map of field types to error strings. |
141 virtual ValidityData InputsAreValid( | 141 virtual ValidityData InputsAreValid( |
142 DialogSection section, | 142 DialogSection section, |
143 const DetailOutputMap& inputs, | 143 const DetailOutputMap& inputs, |
144 ValidationType validation_type) = 0; | 144 ValidationType validation_type) = 0; |
145 | 145 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // The web contents that prompted the dialog. | 207 // The web contents that prompted the dialog. |
208 virtual content::WebContents* web_contents() = 0; | 208 virtual content::WebContents* web_contents() = 0; |
209 | 209 |
210 protected: | 210 protected: |
211 virtual ~AutofillDialogViewDelegate(); | 211 virtual ~AutofillDialogViewDelegate(); |
212 }; | 212 }; |
213 | 213 |
214 } // namespace autofill | 214 } // namespace autofill |
215 | 215 |
216 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ | 216 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
OLD | NEW |