| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 13 #include "chrome/browser/ui/views/payments/editor_view_controller.h" | 14 #include "chrome/browser/ui/views/payments/editor_view_controller.h" |
| 14 #include "chrome/browser/ui/views/payments/validation_delegate.h" | 15 #include "chrome/browser/ui/views/payments/validation_delegate.h" |
| 15 | 16 |
| 16 namespace autofill { | 17 namespace autofill { |
| 17 class AutofillProfile; | 18 class AutofillProfile; |
| 18 } // namespace autofill | 19 } // namespace autofill |
| 19 | 20 |
| 20 namespace payments { | 21 namespace payments { |
| 21 | 22 |
| 22 class ContactInfoEditorViewController : public EditorViewController { | 23 class ContactInfoEditorViewController : public EditorViewController { |
| 23 public: | 24 public: |
| 24 // Does not take ownership of the arguments, which should outlive this object. | 25 // Does not take ownership of the arguments, which should outlive this object. |
| 25 // Passing nullptr as |profile| indicates that we are editing a new profile; | 26 // Passing nullptr as |profile| indicates that we are editing a new profile; |
| 26 // other arguments should never be null. | 27 // other arguments should never be null. |
| 27 ContactInfoEditorViewController(PaymentRequestSpec* spec, | 28 ContactInfoEditorViewController(PaymentRequestSpec* spec, |
| 28 PaymentRequestState* state, | 29 PaymentRequestState* state, |
| 29 PaymentRequestDialogView* dialog, | 30 PaymentRequestDialogView* dialog, |
| 31 BackNavigationType back_navigation_type, |
| 30 autofill::AutofillProfile* profile); | 32 autofill::AutofillProfile* profile); |
| 31 ~ContactInfoEditorViewController() override; | 33 ~ContactInfoEditorViewController() override; |
| 32 | 34 |
| 33 // EditorViewController: | 35 // EditorViewController: |
| 34 std::unique_ptr<views::View> CreateHeaderView() override; | 36 std::unique_ptr<views::View> CreateHeaderView() override; |
| 37 std::unique_ptr<views::View> CreateCustomFieldsView() override; |
| 38 |
| 35 std::vector<EditorField> GetFieldDefinitions() override; | 39 std::vector<EditorField> GetFieldDefinitions() override; |
| 36 base::string16 GetInitialValueForType( | 40 base::string16 GetInitialValueForType( |
| 37 autofill::ServerFieldType type) override; | 41 autofill::ServerFieldType type) override; |
| 38 bool ValidateModelAndSave() override; | 42 bool ValidateModelAndSave() override; |
| 39 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 43 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
| 40 const EditorField& field) override; | 44 const EditorField& field) override; |
| 41 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( | 45 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( |
| 42 const autofill::ServerFieldType& type) override; | 46 const autofill::ServerFieldType& type) override; |
| 43 | 47 |
| 44 protected: | 48 protected: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 69 EditorField field_; | 73 EditorField field_; |
| 70 // Outlives this class. Never null. | 74 // Outlives this class. Never null. |
| 71 EditorViewController* controller_; | 75 EditorViewController* controller_; |
| 72 const std::string& locale_; | 76 const std::string& locale_; |
| 73 }; | 77 }; |
| 74 }; | 78 }; |
| 75 | 79 |
| 76 } // namespace payments | 80 } // namespace payments |
| 77 | 81 |
| 78 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_
H_ | 82 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CONTACT_INFO_EDITOR_VIEW_CONTROLLER_
H_ |
| OLD | NEW |