| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 std::unique_ptr<views::View> CreateExtraFooterView() override; | 52 std::unique_ptr<views::View> CreateExtraFooterView() override; |
| 53 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 53 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 54 | 54 |
| 55 // Returns a representation of the given profile appropriate for display | 55 // Returns a representation of the given profile appropriate for display |
| 56 // in this context. | 56 // in this context. |
| 57 virtual std::unique_ptr<views::View> GetLabel( | 57 virtual std::unique_ptr<views::View> GetLabel( |
| 58 autofill::AutofillProfile* profile) = 0; | 58 autofill::AutofillProfile* profile) = 0; |
| 59 | 59 |
| 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 |
| 63 // if |profile| is null. |
| 64 virtual void ShowEditor(autofill::AutofillProfile* profile) = 0; |
| 65 |
| 62 virtual autofill::AutofillProfile* GetSelectedProfile() = 0; | 66 virtual autofill::AutofillProfile* GetSelectedProfile() = 0; |
| 63 | 67 |
| 64 protected: | 68 protected: |
| 65 // Does not take ownership of the arguments, which should outlive this object. | 69 // Does not take ownership of the arguments, which should outlive this object. |
| 66 ProfileListViewController(PaymentRequestSpec* spec, | 70 ProfileListViewController(PaymentRequestSpec* spec, |
| 67 PaymentRequestState* state, | 71 PaymentRequestState* state, |
| 68 PaymentRequestDialogView* dialog); | 72 PaymentRequestDialogView* dialog); |
| 69 | 73 |
| 70 // Returns the profiles cached by |request| which are appropriate for display | 74 // Returns the profiles cached by |request| which are appropriate for display |
| 71 // in this context. | 75 // in this context. |
| 72 virtual std::vector<autofill::AutofillProfile*> GetProfiles() = 0; | 76 virtual std::vector<autofill::AutofillProfile*> GetProfiles() = 0; |
| 73 | 77 |
| 74 virtual DialogViewID GetDialogViewId() = 0; | 78 virtual DialogViewID GetDialogViewId() = 0; |
| 75 | 79 |
| 76 void PopulateList(); | 80 void PopulateList(); |
| 77 | 81 |
| 78 // PaymentRequestSheetController: | 82 // PaymentRequestSheetController: |
| 79 void FillContentView(views::View* content_view) override; | 83 void FillContentView(views::View* content_view) override; |
| 80 | 84 |
| 81 // Settings and events related to the secondary button in the footer area. | 85 // Settings and events related to the secondary button in the footer area. |
| 82 virtual int GetSecondaryButtonTextId() = 0; | 86 virtual int GetSecondaryButtonTextId() = 0; |
| 83 virtual int GetSecondaryButtonTag() = 0; | 87 virtual int GetSecondaryButtonTag() = 0; |
| 84 virtual int GetSecondaryButtonViewId() = 0; | 88 virtual int GetSecondaryButtonViewId() = 0; |
| 85 virtual void OnSecondaryButtonPressed() = 0; | |
| 86 | 89 |
| 87 private: | 90 private: |
| 88 std::unique_ptr<views::Button> CreateRow(autofill::AutofillProfile* profile); | 91 std::unique_ptr<views::Button> CreateRow(autofill::AutofillProfile* profile); |
| 89 PaymentRequestItemList list_; | 92 PaymentRequestItemList list_; |
| 90 | 93 |
| 91 DISALLOW_COPY_AND_ASSIGN(ProfileListViewController); | 94 DISALLOW_COPY_AND_ASSIGN(ProfileListViewController); |
| 92 }; | 95 }; |
| 93 | 96 |
| 94 } // namespace payments | 97 } // namespace payments |
| 95 | 98 |
| 96 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ | 99 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ |
| OLD | NEW |