| 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_PROFILE_LIST_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual void SelectProfile(autofill::AutofillProfile* profile) = 0; | 60 virtual void SelectProfile(autofill::AutofillProfile* profile) = 0; |
| 61 | 61 |
| 62 // Shows an editor for modifying |profile|, or for creating a new profile | 62 // Shows an editor for modifying |profile|, or for creating a new profile |
| 63 // if |profile| is null. | 63 // if |profile| is null. |
| 64 virtual void ShowEditor(autofill::AutofillProfile* profile) = 0; | 64 virtual void ShowEditor(autofill::AutofillProfile* profile) = 0; |
| 65 | 65 |
| 66 virtual autofill::AutofillProfile* GetSelectedProfile() = 0; | 66 virtual autofill::AutofillProfile* GetSelectedProfile() = 0; |
| 67 | 67 |
| 68 virtual bool IsValidProfile(const autofill::AutofillProfile& profile) = 0; | 68 virtual bool IsValidProfile(const autofill::AutofillProfile& profile) = 0; |
| 69 | 69 |
| 70 // Whether |profile| should be displayed in a disabled state and not |
| 71 // selectable. |
| 72 bool IsDisabled(autofill::AutofillProfile* profile); |
| 73 |
| 70 protected: | 74 protected: |
| 71 // Does not take ownership of the arguments, which should outlive this object. | 75 // Does not take ownership of the arguments, which should outlive this object. |
| 72 ProfileListViewController(PaymentRequestSpec* spec, | 76 ProfileListViewController(PaymentRequestSpec* spec, |
| 73 PaymentRequestState* state, | 77 PaymentRequestState* state, |
| 74 PaymentRequestDialogView* dialog); | 78 PaymentRequestDialogView* dialog); |
| 75 | 79 |
| 76 // Returns the profiles cached by |request| which are appropriate for display | 80 // Returns the profiles cached by |request| which are appropriate for display |
| 77 // in this context. | 81 // in this context. |
| 78 virtual std::vector<autofill::AutofillProfile*> GetProfiles() = 0; | 82 virtual std::vector<autofill::AutofillProfile*> GetProfiles() = 0; |
| 79 | 83 |
| 80 virtual DialogViewID GetDialogViewId() = 0; | 84 virtual DialogViewID GetDialogViewId() = 0; |
| 81 | 85 |
| 86 // Subclasses may choose to provide a header view to go on top of the item |
| 87 // list view. |
| 88 virtual std::unique_ptr<views::View> CreateHeaderView(); |
| 89 |
| 82 void PopulateList(); | 90 void PopulateList(); |
| 83 | 91 |
| 84 // PaymentRequestSheetController: | 92 // PaymentRequestSheetController: |
| 85 void FillContentView(views::View* content_view) override; | 93 void FillContentView(views::View* content_view) override; |
| 86 | 94 |
| 87 // Settings and events related to the secondary button in the footer area. | 95 // Settings and events related to the secondary button in the footer area. |
| 88 virtual int GetSecondaryButtonTextId() = 0; | 96 virtual int GetSecondaryButtonTextId() = 0; |
| 89 virtual int GetSecondaryButtonTag() = 0; | 97 virtual int GetSecondaryButtonTag() = 0; |
| 90 virtual int GetSecondaryButtonViewId() = 0; | 98 virtual int GetSecondaryButtonViewId() = 0; |
| 91 | 99 |
| 92 private: | 100 private: |
| 93 std::unique_ptr<views::Button> CreateRow(autofill::AutofillProfile* profile); | 101 std::unique_ptr<views::Button> CreateRow(autofill::AutofillProfile* profile); |
| 94 PaymentRequestItemList list_; | 102 PaymentRequestItemList list_; |
| 95 | 103 |
| 96 DISALLOW_COPY_AND_ASSIGN(ProfileListViewController); | 104 DISALLOW_COPY_AND_ASSIGN(ProfileListViewController); |
| 97 }; | 105 }; |
| 98 | 106 |
| 99 } // namespace payments | 107 } // namespace payments |
| 100 | 108 |
| 101 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ | 109 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ |
| OLD | NEW |