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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 virtual bool InputIsEditable(const DetailInput& input, | 139 virtual bool InputIsEditable(const DetailInput& input, |
140 DialogSection section) = 0; | 140 DialogSection section) = 0; |
141 | 141 |
142 // Decides whether input of |value| is valid for a field of type |type|. If | 142 // Decides whether input of |value| is valid for a field of type |type|. If |
143 // valid, the returned string will be empty. Otherwise it will contain an | 143 // valid, the returned string will be empty. Otherwise it will contain an |
144 // error message. | 144 // error message. |
145 virtual string16 InputValidityMessage(DialogSection section, | 145 virtual string16 InputValidityMessage(DialogSection section, |
146 ServerFieldType type, | 146 ServerFieldType type, |
147 const string16& value) = 0; | 147 const string16& value) = 0; |
148 | 148 |
149 | |
150 // Decides whether the combination of all |inputs| is valid, returns a | 149 // Decides whether the combination of all |inputs| is valid, returns a |
151 // map of field types to validity messages. | 150 // map of field types to validity messages. |
152 virtual ValidityMessages InputsAreValid(DialogSection section, | 151 virtual ValidityMessages InputsAreValid(DialogSection section, |
153 const FieldValueMap& inputs) = 0; | 152 const FieldValueMap& inputs) = 0; |
154 | 153 |
155 // Called when the user changes the contents of a text field or activates it | 154 // Called when the user changes the contents of a text field or activates it |
156 // (by focusing and then clicking it). |was_edit| is true when the function | 155 // (by focusing and then clicking it). |was_edit| is true when the function |
157 // was called in response to the user editing the text field. | 156 // was called in response to the user editing the text field. |
158 virtual void UserEditedOrActivatedInput(DialogSection section, | 157 virtual void UserEditedOrActivatedInput(DialogSection section, |
159 ServerFieldType type, | 158 ServerFieldType type, |
160 gfx::NativeView parent_view, | 159 gfx::NativeView parent_view, |
161 const gfx::Rect& content_bounds, | 160 const gfx::Rect& content_bounds, |
162 const string16& field_contents, | 161 const string16& field_contents, |
163 bool was_edit) = 0; | 162 bool was_edit) = 0; |
164 | 163 |
165 // The view forwards keypresses in text inputs. Returns true if there should | 164 // The view forwards keypresses in text inputs. Returns true if there should |
166 // be no further processing of the event. | 165 // be no further processing of the event. |
167 virtual bool HandleKeyPressEventInInput( | 166 virtual bool HandleKeyPressEventInInput( |
168 const content::NativeWebKeyboardEvent& event) = 0; | 167 const content::NativeWebKeyboardEvent& event) = 0; |
169 | 168 |
| 169 // Called when a user selects an item in a combobox. |
| 170 virtual void ComboboxItemSelected(ui::ComboboxModel* model, |
| 171 DialogSection section, |
| 172 int index) = 0; |
| 173 |
170 // Called when focus has changed position within the view. | 174 // Called when focus has changed position within the view. |
171 virtual void FocusMoved() = 0; | 175 virtual void FocusMoved() = 0; |
172 | 176 |
173 // Whether the view should show a validation error bubble. | 177 // Whether the view should show a validation error bubble. |
174 virtual bool ShouldShowErrorBubble() const = 0; | 178 virtual bool ShouldShowErrorBubble() const = 0; |
175 | 179 |
176 // Miscellany ---------------------------------------------------------------- | 180 // Miscellany ---------------------------------------------------------------- |
177 | 181 |
178 // Called when the view has been closed. | 182 // Called when the view has been closed. |
179 virtual void ViewClosed() = 0; | 183 virtual void ViewClosed() = 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // The web contents that prompted the dialog. | 215 // The web contents that prompted the dialog. |
212 virtual content::WebContents* GetWebContents() = 0; | 216 virtual content::WebContents* GetWebContents() = 0; |
213 | 217 |
214 protected: | 218 protected: |
215 virtual ~AutofillDialogViewDelegate(); | 219 virtual ~AutofillDialogViewDelegate(); |
216 }; | 220 }; |
217 | 221 |
218 } // namespace autofill | 222 } // namespace autofill |
219 | 223 |
220 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ | 224 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
OLD | NEW |