| 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/payment_method_view_controller.h" | 5 #include "chrome/browser/ui/views/payments/payment_method_view_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 constexpr int kFirstTagValue = static_cast<int>( | 34 constexpr int kFirstTagValue = static_cast<int>( |
| 35 payments::PaymentRequestCommonTags::PAYMENT_REQUEST_COMMON_TAG_MAX); | 35 payments::PaymentRequestCommonTags::PAYMENT_REQUEST_COMMON_TAG_MAX); |
| 36 | 36 |
| 37 enum class PaymentMethodViewControllerTags : int { | 37 enum class PaymentMethodViewControllerTags : int { |
| 38 // The tag for the button that triggers the "add card" flow. Starts at | 38 // The tag for the button that triggers the "add card" flow. Starts at |
| 39 // |kFirstTagValue| not to conflict with tags common to all views. | 39 // |kFirstTagValue| not to conflict with tags common to all views. |
| 40 ADD_CREDIT_CARD_BUTTON = kFirstTagValue, | 40 ADD_CREDIT_CARD_BUTTON = kFirstTagValue, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class PaymentMethodListItem : public payments::PaymentRequestItemList::Item, | 43 class PaymentMethodListItem : public payments::PaymentRequestItemList::Item { |
| 44 public views::ButtonListener { | |
| 45 public: | 44 public: |
| 46 // Does not take ownership of |card|, which should not be null and should | 45 // Does not take ownership of |card|, which should not be null and should |
| 47 // outlive this object. |list| is the PaymentRequestItemList object that will | 46 // outlive this object. |list| is the PaymentRequestItemList object that will |
| 48 // own this. | 47 // own this. |
| 49 PaymentMethodListItem(autofill::CreditCard* card, | 48 PaymentMethodListItem(autofill::CreditCard* card, |
| 50 PaymentRequest* request, | 49 PaymentRequest* request, |
| 51 PaymentRequestItemList* list, | 50 PaymentRequestItemList* list, |
| 52 bool selected) | 51 bool selected) |
| 53 : payments::PaymentRequestItemList::Item(request, list, selected), | 52 : payments::PaymentRequestItemList::Item(request, list, selected), |
| 54 card_(card) {} | 53 card_(card) {} |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 PaymentMethodViewControllerTags::ADD_CREDIT_CARD_BUTTON): | 209 PaymentMethodViewControllerTags::ADD_CREDIT_CARD_BUTTON): |
| 211 dialog()->ShowCreditCardEditor(); | 210 dialog()->ShowCreditCardEditor(); |
| 212 break; | 211 break; |
| 213 default: | 212 default: |
| 214 PaymentRequestSheetController::ButtonPressed(sender, event); | 213 PaymentRequestSheetController::ButtonPressed(sender, event); |
| 215 break; | 214 break; |
| 216 } | 215 } |
| 217 } | 216 } |
| 218 | 217 |
| 219 } // namespace payments | 218 } // namespace payments |
| OLD | NEW |