| 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/resource/resource_bundle.h" |
| 14 #include "ui/base/ui_base_types.h" | 15 #include "ui/base/ui_base_types.h" |
| 15 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 17 #include "ui/gfx/range/range.h" | 18 #include "ui/gfx/range/range.h" |
| 18 | 19 |
| 19 class FieldValueMap; | 20 class FieldValueMap; |
| 20 class GURL; | 21 class GURL; |
| 21 class Profile; | 22 class Profile; |
| 22 | 23 |
| 23 namespace content { | 24 namespace content { |
| 24 class WebContents; | 25 class WebContents; |
| 25 struct NativeWebKeyboardEvent; | 26 struct NativeWebKeyboardEvent; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace gfx { | 29 namespace gfx { |
| 29 class Rect; | 30 class Rect; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace ui { | 33 namespace ui { |
| 33 class ComboboxModel; | 34 class ComboboxModel; |
| 34 class MenuModel; | 35 class MenuModel; |
| 35 } | 36 } |
| 36 | 37 |
| 37 namespace autofill { | 38 namespace autofill { |
| 38 | 39 |
| 39 typedef std::map<ServerFieldType, gfx::Image> FieldIconMap; | 40 typedef std::map<ServerFieldType, gfx::Image> FieldIconMap; |
| 40 | 41 |
| 42 struct SectionLabel { |
| 43 // Text that describes a section (e.g. Billing). |
| 44 base::string16 text; |
| 45 // The font style that |text| should be shown as. |
| 46 ui::ResourceBundle::FontStyle font; |
| 47 }; |
| 48 |
| 41 // This class defines the interface to the controller that the dialog view sees. | 49 // This class defines the interface to the controller that the dialog view sees. |
| 42 class AutofillDialogViewDelegate { | 50 class AutofillDialogViewDelegate { |
| 43 public: | 51 public: |
| 44 // Strings ------------------------------------------------------------------- | 52 // Strings ------------------------------------------------------------------- |
| 45 | 53 |
| 46 virtual base::string16 DialogTitle() const = 0; | 54 virtual base::string16 DialogTitle() const = 0; |
| 47 virtual base::string16 AccountChooserText() const = 0; | 55 virtual base::string16 AccountChooserText() const = 0; |
| 48 virtual base::string16 SignInLinkText() const = 0; | 56 virtual base::string16 SignInLinkText() const = 0; |
| 49 virtual base::string16 SpinnerText() const = 0; | 57 virtual base::string16 SpinnerText() const = 0; |
| 50 virtual base::string16 EditSuggestionText() const = 0; | 58 virtual base::string16 EditSuggestionText() const = 0; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Returns the combobox model for inputs of type |type|, or NULL if the input | 121 // Returns the combobox model for inputs of type |type|, or NULL if the input |
| 114 // should be a text field. | 122 // should be a text field. |
| 115 virtual ui::ComboboxModel* ComboboxModelForAutofillType( | 123 virtual ui::ComboboxModel* ComboboxModelForAutofillType( |
| 116 ServerFieldType type) = 0; | 124 ServerFieldType type) = 0; |
| 117 | 125 |
| 118 // Returns the model for suggestions for fields that fall under |section|. | 126 // Returns the model for suggestions for fields that fall under |section|. |
| 119 // This may return NULL, in which case no menu should be shown for that | 127 // This may return NULL, in which case no menu should be shown for that |
| 120 // section. | 128 // section. |
| 121 virtual ui::MenuModel* MenuModelForSection(DialogSection section) = 0; | 129 virtual ui::MenuModel* MenuModelForSection(DialogSection section) = 0; |
| 122 | 130 |
| 123 // Returns the label text used to describe the section (i.e. Billing). | 131 // Returns the label text and font that describe the section (i.e. Billing). |
| 124 virtual base::string16 LabelForSection(DialogSection section) const = 0; | 132 virtual SectionLabel LabelForSection(DialogSection section) const = 0; |
| 125 | 133 |
| 126 // Returns the current state of suggestions for |section|. | 134 // Returns the current state of suggestions for |section|. |
| 127 virtual SuggestionState SuggestionStateForSection(DialogSection section) = 0; | 135 virtual SuggestionState SuggestionStateForSection(DialogSection section) = 0; |
| 128 | 136 |
| 129 // Returns the icons to be displayed along with the given |user_inputs| in a | 137 // Returns the icons to be displayed along with the given |user_inputs| in a |
| 130 // section. | 138 // section. |
| 131 virtual FieldIconMap IconsForFields( | 139 virtual FieldIconMap IconsForFields( |
| 132 const FieldValueMap& user_inputs) const = 0; | 140 const FieldValueMap& user_inputs) const = 0; |
| 133 | 141 |
| 134 // Returns true if the value of this field |type| controls the icons for the | 142 // Returns true if the value of this field |type| controls the icons for the |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // The web contents that prompted the dialog. | 221 // The web contents that prompted the dialog. |
| 214 virtual content::WebContents* GetWebContents() = 0; | 222 virtual content::WebContents* GetWebContents() = 0; |
| 215 | 223 |
| 216 protected: | 224 protected: |
| 217 virtual ~AutofillDialogViewDelegate(); | 225 virtual ~AutofillDialogViewDelegate(); |
| 218 }; | 226 }; |
| 219 | 227 |
| 220 } // namespace autofill | 228 } // namespace autofill |
| 221 | 229 |
| 222 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ | 230 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_DELEGATE_H_ |
| OLD | NEW |