| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Creates a controller which lists and allows selection of profiles | 43 // Creates a controller which lists and allows selection of profiles |
| 44 // for contact info. | 44 // for contact info. |
| 45 static std::unique_ptr<ProfileListViewController> | 45 static std::unique_ptr<ProfileListViewController> |
| 46 GetContactProfileViewController(PaymentRequestSpec* spec, | 46 GetContactProfileViewController(PaymentRequestSpec* spec, |
| 47 PaymentRequestState* state, | 47 PaymentRequestState* state, |
| 48 PaymentRequestDialogView* dialog); | 48 PaymentRequestDialogView* dialog); |
| 49 | 49 |
| 50 // PaymentRequestSheetController: | 50 // PaymentRequestSheetController: |
| 51 std::unique_ptr<views::View> CreateView() override; | 51 std::unique_ptr<views::View> CreateView() override; |
| 52 std::unique_ptr<views::View> CreateExtraFooterView() override; |
| 53 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 52 | 54 |
| 53 // Returns a representation of the given profile appropriate for display | 55 // Returns a representation of the given profile appropriate for display |
| 54 // in this context. | 56 // in this context. |
| 55 virtual std::unique_ptr<views::View> GetLabel( | 57 virtual std::unique_ptr<views::View> GetLabel( |
| 56 autofill::AutofillProfile* profile) = 0; | 58 autofill::AutofillProfile* profile) = 0; |
| 57 | 59 |
| 58 virtual void SelectProfile(autofill::AutofillProfile* profile) = 0; | 60 virtual void SelectProfile(autofill::AutofillProfile* profile) = 0; |
| 59 | 61 |
| 60 virtual autofill::AutofillProfile* GetSelectedProfile() = 0; | 62 virtual autofill::AutofillProfile* GetSelectedProfile() = 0; |
| 61 | 63 |
| 62 protected: | 64 protected: |
| 63 // Does not take ownership of the arguments, which should outlive this object. | 65 // Does not take ownership of the arguments, which should outlive this object. |
| 64 ProfileListViewController(PaymentRequestSpec* spec, | 66 ProfileListViewController(PaymentRequestSpec* spec, |
| 65 PaymentRequestState* state, | 67 PaymentRequestState* state, |
| 66 PaymentRequestDialogView* dialog); | 68 PaymentRequestDialogView* dialog); |
| 67 | 69 |
| 68 // Returns the profiles cached by |request| which are appropriate for display | 70 // Returns the profiles cached by |request| which are appropriate for display |
| 69 // in this context. | 71 // in this context. |
| 70 virtual std::vector<autofill::AutofillProfile*> GetProfiles() = 0; | 72 virtual std::vector<autofill::AutofillProfile*> GetProfiles() = 0; |
| 71 | 73 |
| 72 // Returns the string displayed at the top of the view. | 74 // Returns the string displayed at the top of the view. |
| 73 virtual base::string16 GetHeaderString() = 0; | 75 virtual base::string16 GetHeaderString() = 0; |
| 74 | 76 |
| 77 // Settings and events related to the secondary button in the footer area. |
| 78 virtual int GetSecondaryButtonTextId() = 0; |
| 79 virtual int GetSecondaryButtonTag() = 0; |
| 80 virtual int GetSecondaryButtonViewId() = 0; |
| 81 virtual void OnSecondaryButtonPressed() = 0; |
| 82 |
| 75 private: | 83 private: |
| 76 std::unique_ptr<views::Button> CreateRow(autofill::AutofillProfile* profile); | 84 std::unique_ptr<views::Button> CreateRow(autofill::AutofillProfile* profile); |
| 77 PaymentRequestItemList list_; | 85 PaymentRequestItemList list_; |
| 78 | 86 |
| 79 DISALLOW_COPY_AND_ASSIGN(ProfileListViewController); | 87 DISALLOW_COPY_AND_ASSIGN(ProfileListViewController); |
| 80 }; | 88 }; |
| 81 | 89 |
| 82 } // namespace payments | 90 } // namespace payments |
| 83 | 91 |
| 84 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_PAYMENTS_PROFILE_LIST_VIEW_CONTROLLER_H_ |
| OLD | NEW |