| 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 #include "chrome/browser/ui/views/payments/profile_list_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/profile_list_view_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" | 7 #include "chrome/browser/ui/views/payments/payment_request_dialog_view.h" |
| 8 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" | 8 #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" |
| 9 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" | 9 #include "chrome/browser/ui/views/payments/payment_request_row_view.h" |
| 10 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" | 10 #include "chrome/browser/ui/views/payments/payment_request_views_util.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 autofill::AutofillProfile* GetSelectedProfile() override { | 116 autofill::AutofillProfile* GetSelectedProfile() override { |
| 117 return state()->selected_shipping_profile(); | 117 return state()->selected_shipping_profile(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 std::vector<autofill::AutofillProfile*> GetProfiles() override { | 120 std::vector<autofill::AutofillProfile*> GetProfiles() override { |
| 121 return state()->shipping_profiles(); | 121 return state()->shipping_profiles(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 base::string16 GetSheetTitle() override { | 124 base::string16 GetSheetTitle() override { |
| 125 return GetShippingAddressSectionString(spec()->options().shipping_type); | 125 return GetShippingAddressSectionString(spec()->shipping_type()); |
| 126 } | 126 } |
| 127 | 127 |
| 128 int GetSecondaryButtonTextId() override { | 128 int GetSecondaryButtonTextId() override { |
| 129 return IDS_AUTOFILL_ADD_ADDRESS_CAPTION; | 129 return IDS_AUTOFILL_ADD_ADDRESS_CAPTION; |
| 130 } | 130 } |
| 131 | 131 |
| 132 int GetSecondaryButtonTag() override { | 132 int GetSecondaryButtonTag() override { |
| 133 return static_cast<int>( | 133 return static_cast<int>( |
| 134 PaymentMethodViewControllerTags::ADD_SHIPPING_ADDRESS_BUTTON); | 134 PaymentMethodViewControllerTags::ADD_SHIPPING_ADDRESS_BUTTON); |
| 135 } | 135 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 153 PaymentRequestDialogView* dialog) | 153 PaymentRequestDialogView* dialog) |
| 154 : ProfileListViewController(spec, state, dialog) { | 154 : ProfileListViewController(spec, state, dialog) { |
| 155 PopulateList(); | 155 PopulateList(); |
| 156 } | 156 } |
| 157 ~ContactProfileViewController() override {} | 157 ~ContactProfileViewController() override {} |
| 158 | 158 |
| 159 protected: | 159 protected: |
| 160 // ProfileListViewController: | 160 // ProfileListViewController: |
| 161 std::unique_ptr<views::View> GetLabel( | 161 std::unique_ptr<views::View> GetLabel( |
| 162 autofill::AutofillProfile* profile) override { | 162 autofill::AutofillProfile* profile) override { |
| 163 return GetContactInfoLabel( | 163 return GetContactInfoLabel(AddressStyleType::DETAILED, |
| 164 AddressStyleType::DETAILED, state()->GetApplicationLocale(), *profile, | 164 state()->GetApplicationLocale(), *profile, |
| 165 spec()->request_payer_name(), spec()->request_payer_phone(), | 165 *spec()); |
| 166 spec()->request_payer_email()); | |
| 167 } | 166 } |
| 168 | 167 |
| 169 void SelectProfile(autofill::AutofillProfile* profile) override { | 168 void SelectProfile(autofill::AutofillProfile* profile) override { |
| 170 state()->SetSelectedContactProfile(profile); | 169 state()->SetSelectedContactProfile(profile); |
| 171 } | 170 } |
| 172 | 171 |
| 173 autofill::AutofillProfile* GetSelectedProfile() override { | 172 autofill::AutofillProfile* GetSelectedProfile() override { |
| 174 return state()->selected_contact_profile(); | 173 return state()->selected_contact_profile(); |
| 175 } | 174 } |
| 176 | 175 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 266 |
| 268 void ProfileListViewController::ButtonPressed(views::Button* sender, | 267 void ProfileListViewController::ButtonPressed(views::Button* sender, |
| 269 const ui::Event& event) { | 268 const ui::Event& event) { |
| 270 if (sender->tag() == GetSecondaryButtonTag()) | 269 if (sender->tag() == GetSecondaryButtonTag()) |
| 271 OnSecondaryButtonPressed(); | 270 OnSecondaryButtonPressed(); |
| 272 else | 271 else |
| 273 PaymentRequestSheetController::ButtonPressed(sender, event); | 272 PaymentRequestSheetController::ButtonPressed(sender, event); |
| 274 } | 273 } |
| 275 | 274 |
| 276 } // namespace payments | 275 } // namespace payments |
| OLD | NEW |