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_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 14 matching lines...) Expand all Loading... |
25 class CreditCardEditorViewController : public EditorViewController { | 25 class CreditCardEditorViewController : public EditorViewController { |
26 public: | 26 public: |
27 // Does not take ownership of the arguments, which should outlive this object. | 27 // Does not take ownership of the arguments, which should outlive this object. |
28 CreditCardEditorViewController(PaymentRequestSpec* spec, | 28 CreditCardEditorViewController(PaymentRequestSpec* spec, |
29 PaymentRequestState* state, | 29 PaymentRequestState* state, |
30 PaymentRequestDialogView* dialog); | 30 PaymentRequestDialogView* dialog); |
31 ~CreditCardEditorViewController() override; | 31 ~CreditCardEditorViewController() override; |
32 | 32 |
33 // EditorViewController: | 33 // EditorViewController: |
34 std::unique_ptr<views::View> CreateHeaderView() override; | 34 std::unique_ptr<views::View> CreateHeaderView() override; |
35 int GetViewHeaderTitleId() const override; | |
36 std::vector<EditorField> GetFieldDefinitions() override; | 35 std::vector<EditorField> GetFieldDefinitions() override; |
37 bool ValidateModelAndSave() override; | 36 bool ValidateModelAndSave() override; |
38 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( | 37 std::unique_ptr<ValidationDelegate> CreateValidationDelegate( |
39 const EditorField& field) override; | 38 const EditorField& field) override; |
40 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( | 39 std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType( |
41 const autofill::ServerFieldType& type) override; | 40 const autofill::ServerFieldType& type) override; |
42 | 41 |
| 42 protected: |
| 43 // PaymentRequestSheetController: |
| 44 base::string16 GetSheetTitle() override; |
| 45 |
43 private: | 46 private: |
44 class CreditCardValidationDelegate : public ValidationDelegate { | 47 class CreditCardValidationDelegate : public ValidationDelegate { |
45 public: | 48 public: |
46 // Used to validate |field| type. A reference to the |controller| should | 49 // Used to validate |field| type. A reference to the |controller| should |
47 // outlive this delegate, and a list of |supported_card_networks| can be | 50 // outlive this delegate, and a list of |supported_card_networks| can be |
48 // passed in to validate |field| (the data will be copied to the delegate). | 51 // passed in to validate |field| (the data will be copied to the delegate). |
49 CreditCardValidationDelegate( | 52 CreditCardValidationDelegate( |
50 const EditorField& field, | 53 const EditorField& field, |
51 EditorViewController* controller, | 54 EditorViewController* controller, |
52 const std::vector<std::string>& supported_card_networks); | 55 const std::vector<std::string>& supported_card_networks); |
(...skipping 15 matching lines...) Expand all Loading... |
68 | 71 |
69 DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); | 72 DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate); |
70 }; | 73 }; |
71 | 74 |
72 DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); | 75 DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController); |
73 }; | 76 }; |
74 | 77 |
75 } // namespace payments | 78 } // namespace payments |
76 | 79 |
77 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H
_ | 80 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H
_ |
OLD | NEW |