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" |
11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
12 #include "components/autofill/content/browser/wallet/required_action.h" | 12 #include "components/autofill/content/browser/wallet/required_action.h" |
13 #include "components/autofill/core/browser/field_types.h" | 13 #include "components/autofill/core/browser/field_types.h" |
14 #include "ui/base/ui_base_types.h" | 14 #include "ui/base/ui_base_types.h" |
15 #include "ui/gfx/image/image.h" | 15 #include "ui/gfx/image/image.h" |
16 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
17 #include "ui/gfx/range/range.h" | 17 #include "ui/gfx/range/range.h" |
18 | 18 |
| 19 class FieldValueMap; |
19 class GURL; | 20 class GURL; |
20 class Profile; | 21 class Profile; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 class WebContents; | 24 class WebContents; |
24 struct NativeWebKeyboardEvent; | 25 struct NativeWebKeyboardEvent; |
25 } | 26 } |
26 | 27 |
27 namespace gfx { | 28 namespace gfx { |
28 class Rect; | 29 class Rect; |
29 } | 30 } |
30 | 31 |
31 namespace ui { | 32 namespace ui { |
32 class ComboboxModel; | 33 class ComboboxModel; |
33 class MenuModel; | 34 class MenuModel; |
34 } | 35 } |
35 | 36 |
36 namespace autofill { | 37 namespace autofill { |
37 | 38 |
38 typedef std::map<ServerFieldType, string16> FieldValueMap; | |
39 typedef std::map<ServerFieldType, gfx::Image> FieldIconMap; | 39 typedef std::map<ServerFieldType, gfx::Image> FieldIconMap; |
40 | 40 |
41 // This class defines the interface to the controller that the dialog view sees. | 41 // This class defines the interface to the controller that the dialog view sees. |
42 class AutofillDialogViewDelegate { | 42 class AutofillDialogViewDelegate { |
43 public: | 43 public: |
44 // Strings ------------------------------------------------------------------- | 44 // Strings ------------------------------------------------------------------- |
45 | 45 |
46 virtual string16 DialogTitle() const = 0; | 46 virtual string16 DialogTitle() const = 0; |
47 virtual string16 AccountChooserText() const = 0; | 47 virtual string16 AccountChooserText() const = 0; |
48 virtual string16 SignInLinkText() const = 0; | 48 virtual string16 SignInLinkText() const = 0; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 149 |
150 // Decides whether the combination of all |inputs| is valid, returns a | 150 // Decides whether the combination of all |inputs| is valid, returns a |
151 // map of field types to validity messages. | 151 // map of field types to validity messages. |
152 virtual ValidityMessages InputsAreValid(DialogSection section, | 152 virtual ValidityMessages InputsAreValid(DialogSection section, |
153 const DetailOutputMap& inputs) = 0; | 153 const FieldValueMap& inputs) = 0; |
154 | 154 |
155 // Called when the user changes the contents of a text field or activates it | 155 // 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 | 156 // (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. | 157 // was called in response to the user editing the text field. |
158 virtual void UserEditedOrActivatedInput(DialogSection section, | 158 virtual void UserEditedOrActivatedInput(DialogSection section, |
159 const DetailInput* input, | 159 ServerFieldType type, |
160 gfx::NativeView parent_view, | 160 gfx::NativeView parent_view, |
161 const gfx::Rect& content_bounds, | 161 const gfx::Rect& content_bounds, |
162 const string16& field_contents, | 162 const string16& field_contents, |
163 bool was_edit) = 0; | 163 bool was_edit) = 0; |
164 | 164 |
165 // The view forwards keypresses in text inputs. Returns true if there should | 165 // The view forwards keypresses in text inputs. Returns true if there should |
166 // be no further processing of the event. | 166 // be no further processing of the event. |
167 virtual bool HandleKeyPressEventInInput( | 167 virtual bool HandleKeyPressEventInInput( |
168 const content::NativeWebKeyboardEvent& event) = 0; | 168 const content::NativeWebKeyboardEvent& event) = 0; |
169 | 169 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 // The web contents that prompted the dialog. | 211 // The web contents that prompted the dialog. |
212 virtual content::WebContents* GetWebContents() = 0; | 212 virtual content::WebContents* GetWebContents() = 0; |
213 | 213 |
214 protected: | 214 protected: |
215 virtual ~AutofillDialogViewDelegate(); | 215 virtual ~AutofillDialogViewDelegate(); |
216 }; | 216 }; |
217 | 217 |
218 } // namespace autofill | 218 } // namespace autofill |
219 | 219 |
220 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ | 220 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
OLD | NEW |