| 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_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROLLER
_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public: | 29 public: |
| 30 // Does not take ownership of the arguments (except for the |on_edited| and | 30 // Does not take ownership of the arguments (except for the |on_edited| and |
| 31 // |on_added| callbacks), which should outlive this object. Additionally, | 31 // |on_added| callbacks), which should outlive this object. Additionally, |
| 32 // |profile| could be nullptr if we are adding a new shipping address. Else, | 32 // |profile| could be nullptr if we are adding a new shipping address. Else, |
| 33 // it's a valid pointer to a card that needs to be updated, and which will | 33 // it's a valid pointer to a card that needs to be updated, and which will |
| 34 // outlive this controller. | 34 // outlive this controller. |
| 35 ShippingAddressEditorViewController( | 35 ShippingAddressEditorViewController( |
| 36 PaymentRequestSpec* spec, | 36 PaymentRequestSpec* spec, |
| 37 PaymentRequestState* state, | 37 PaymentRequestState* state, |
| 38 PaymentRequestDialogView* dialog, | 38 PaymentRequestDialogView* dialog, |
| 39 BackNavigationType back_navigation_type, |
| 39 base::OnceClosure on_edited, | 40 base::OnceClosure on_edited, |
| 40 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, | 41 base::OnceCallback<void(const autofill::AutofillProfile&)> on_added, |
| 41 autofill::AutofillProfile* profile); | 42 autofill::AutofillProfile* profile); |
| 42 ~ShippingAddressEditorViewController() override; | 43 ~ShippingAddressEditorViewController() override; |
| 43 | 44 |
| 44 // EditorViewController: | 45 // EditorViewController: |
| 45 std::unique_ptr<views::View> CreateHeaderView() override; | |
| 46 std::vector<EditorField> GetFieldDefinitions() override; | 46 std::vector<EditorField> GetFieldDefinitions() override; |
| 47 base::string16 GetInitialValueForType( | 47 base::string16 GetInitialValueForType( |
| 48 autofill::ServerFieldType type) override; | 48 autofill::ServerFieldType type) override; |
| 49 bool ValidateModelAndSave() override; | 49 bool ValidateModelAndSave() override; |
| 50 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 50 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
| 51 const EditorField& field) override; | 51 const EditorField& field) override; |
| 52 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( | 52 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( |
| 53 const autofill::ServerFieldType& type) override; | 53 const autofill::ServerFieldType& type) override; |
| 54 void OnPerformAction(views::Combobox* combobox) override; | 54 void OnPerformAction(views::Combobox* combobox) override; |
| 55 void UpdateEditorView() override; | 55 void UpdateEditorView() override; |
| 56 | 56 |
| 57 // PaymentRequestSheetController: | 57 // PaymentRequestSheetController: |
| 58 base::string16 GetSheetTitle() override; | 58 base::string16 GetSheetTitle() override; |
| 59 std::unique_ptr<views::Button> CreatePrimaryButton() override; |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 bool GetSheetId(DialogViewID* sheet_id) override; | 62 bool GetSheetId(DialogViewID* sheet_id) override; |
| 62 | 63 |
| 63 class ShippingAddressValidationDelegate : public ValidationDelegate { | 64 class ShippingAddressValidationDelegate : public ValidationDelegate { |
| 64 public: | 65 public: |
| 65 ShippingAddressValidationDelegate( | 66 ShippingAddressValidationDelegate( |
| 66 ShippingAddressEditorViewController* parent, | 67 ShippingAddressEditorViewController* parent, |
| 67 const EditorField& field); | 68 const EditorField& field); |
| 68 ~ShippingAddressValidationDelegate() override; | 69 ~ShippingAddressValidationDelegate() override; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 // Failed to fetch the region data in time. | 133 // Failed to fetch the region data in time. |
| 133 void RegionDataLoadTimedOut(); | 134 void RegionDataLoadTimedOut(); |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); | 136 DISALLOW_COPY_AND_ASSIGN(ShippingAddressEditorViewController); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace payments | 139 } // namespace payments |
| 139 | 140 |
| 140 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL
LER_H_ | 141 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_SHIPPING_ADDRESS_EDITOR_VIEW_CONTROL
LER_H_ |
| OLD | NEW |