Index: chrome/browser/ui/views/payments/editor_view_controller.h |
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.h b/chrome/browser/ui/views/payments/editor_view_controller.h |
index 60e229c09fda672f524ec42b19d816fb628b4f12..10cf521dfc03aee4455b0a1ef565a8916ad4958f 100644 |
--- a/chrome/browser/ui/views/payments/editor_view_controller.h |
+++ b/chrome/browser/ui/views/payments/editor_view_controller.h |
@@ -57,12 +57,6 @@ struct EditorField { |
required(required), |
control_type(control_type) {} |
- struct Compare { |
- bool operator()(const EditorField& lhs, const EditorField& rhs) const { |
- return std::tie(lhs.type, lhs.label) < std::tie(rhs.type, rhs.label); |
- } |
- }; |
- |
// Data type in the field. |
autofill::ServerFieldType type; |
// Label to be shown alongside the field. |
@@ -85,8 +79,7 @@ class EditorViewController : public PaymentRequestSheetController, |
std::unordered_map<ValidatingTextfield*, const EditorField>; |
using ComboboxMap = |
std::unordered_map<ValidatingCombobox*, const EditorField>; |
- using ErrorLabelMap = |
- std::map<const EditorField, views::View*, EditorField::Compare>; |
+ using ErrorLabelMap = std::map<autofill::ServerFieldType, views::View*>; |
// Does not take ownership of the arguments, which should outlive this object. |
// |back_navigation_type| identifies what sort of back navigation should be |
@@ -99,8 +92,8 @@ class EditorViewController : public PaymentRequestSheetController, |
~EditorViewController() override; |
// Will display |error_message| alongside the input field represented by |
- // |field|. |
- void DisplayErrorMessageForField(const EditorField& field, |
+ // field |type|. |
+ void DisplayErrorMessageForField(autofill::ServerFieldType type, |
const base::string16& error_message); |
const ComboboxMap& comboboxes() const { return comboboxes_; } |
@@ -147,6 +140,11 @@ class EditorViewController : public PaymentRequestSheetController, |
void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
views::View* GetFirstFocusedView() override; |
+ // Will create a combobox according to the |field| definition. Will also keep |
+ // track of this field to populate the edited model on save. |
+ std::unique_ptr<ValidatingCombobox> CreateComboboxForField( |
+ const EditorField& field); |
+ |
private: |
// views::TextfieldController: |
void ContentsChanged(views::Textfield* sender, |