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