Chromium Code Reviews| Index: components/payments/core/autofill_payment_instrument.h |
| diff --git a/components/payments/core/autofill_payment_instrument.h b/components/payments/core/autofill_payment_instrument.h |
| index ca0e125d666fc2c50c9c6e2c1e6577db4ffd6325..1a270c69cf2dbf0dc62ab2d5272e138e64a3d055 100644 |
| --- a/components/payments/core/autofill_payment_instrument.h |
| +++ b/components/payments/core/autofill_payment_instrument.h |
| @@ -11,6 +11,7 @@ |
| #include "base/macros.h" |
| #include "components/autofill/core/browser/credit_card.h" |
| +#include "components/autofill/core/browser/payments/full_card_request.h" |
| #include "components/payments/core/payment_instrument.h" |
| namespace autofill { |
| @@ -21,28 +22,49 @@ namespace payments { |
| // Represents an Autofill/Payments credit card form of payment in Payment |
| // Request. |
| -class AutofillPaymentInstrument : public PaymentInstrument { |
| +class AutofillPaymentInstrument |
| + : public PaymentInstrument, |
| + public autofill::payments::FullCardRequest::ResultDelegate { |
| public: |
| + class FullCardRequestDelegate { |
| + public: |
|
please use gerrit instead
2017/03/30 13:14:10
Need an empty virtual destructor.
anthonyvd
2017/03/30 15:43:41
Done.
|
| + virtual void DoFullCardRequest( |
| + const autofill::CreditCard& credit_card, |
| + base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> |
| + result_delegate) = 0; |
| + }; |
| + |
| // |billing_profiles| is owned by the caller and should outlive this object. |
| AutofillPaymentInstrument( |
| const std::string& method_name, |
| const autofill::CreditCard& card, |
| const std::vector<autofill::AutofillProfile*>& billing_profiles, |
| - const std::string& app_locale); |
| + const std::string& app_locale, |
| + FullCardRequestDelegate* full_card_request_delegate); |
|
please use gerrit instead
2017/03/30 13:14:10
Add a comment about ownership of full_Card_request
anthonyvd
2017/03/30 15:43:41
Done.
|
| ~AutofillPaymentInstrument() override; |
| // PaymentInstrument: |
| void InvokePaymentApp(PaymentInstrument::Delegate* delegate) override; |
| bool IsValid() override; |
| + // autofill::payments::FullCardRequest::ResultDelegate: |
| + void OnFullCardRequestSucceeded(const autofill::CreditCard& card, |
| + const base::string16& cvc) override; |
| + void OnFullCardRequestFailed() override; |
| + |
| private: |
| // A copy of the card is owned by this object. |
| - const autofill::CreditCard credit_card_; |
| + autofill::CreditCard credit_card_; |
| // Not owned by this object, should outlive this. |
| const std::vector<autofill::AutofillProfile*>& billing_profiles_; |
| const std::string app_locale_; |
| + PaymentInstrument::Delegate* delegate_; |
| + FullCardRequestDelegate* full_card_request_delegate_; |
| + |
| + base::WeakPtrFactory<AutofillPaymentInstrument> weak_ptr_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AutofillPaymentInstrument); |
| }; |