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 COMPONENTS_PAYMENTS_CORE_AUTOFILL_PAYMENT_INSTRUMENT_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CORE_AUTOFILL_PAYMENT_INSTRUMENT_H_ |
6 #define COMPONENTS_PAYMENTS_CORE_AUTOFILL_PAYMENT_INSTRUMENT_H_ | 6 #define COMPONENTS_PAYMENTS_CORE_AUTOFILL_PAYMENT_INSTRUMENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 22 matching lines...) Expand all Loading... |
33 AutofillPaymentInstrument( | 33 AutofillPaymentInstrument( |
34 const std::string& method_name, | 34 const std::string& method_name, |
35 const autofill::CreditCard& card, | 35 const autofill::CreditCard& card, |
36 const std::vector<autofill::AutofillProfile*>& billing_profiles, | 36 const std::vector<autofill::AutofillProfile*>& billing_profiles, |
37 const std::string& app_locale, | 37 const std::string& app_locale, |
38 PaymentRequestDelegate* payment_request_delegate); | 38 PaymentRequestDelegate* payment_request_delegate); |
39 ~AutofillPaymentInstrument() override; | 39 ~AutofillPaymentInstrument() override; |
40 | 40 |
41 // PaymentInstrument: | 41 // PaymentInstrument: |
42 void InvokePaymentApp(PaymentInstrument::Delegate* delegate) override; | 42 void InvokePaymentApp(PaymentInstrument::Delegate* delegate) override; |
43 bool IsCompleteForPayment() override; | 43 bool IsCompleteForPayment(base::string16* missing_info) override; |
44 bool IsValidForCanMakePayment() override; | 44 bool IsValidForCanMakePayment() override; |
45 | 45 |
46 // autofill::payments::FullCardRequest::ResultDelegate: | 46 // autofill::payments::FullCardRequest::ResultDelegate: |
47 void OnFullCardRequestSucceeded(const autofill::CreditCard& card, | 47 void OnFullCardRequestSucceeded(const autofill::CreditCard& card, |
48 const base::string16& cvc) override; | 48 const base::string16& cvc) override; |
49 void OnFullCardRequestFailed() override; | 49 void OnFullCardRequestFailed() override; |
50 | 50 |
51 autofill::CreditCard* credit_card() { return &credit_card_; } | 51 autofill::CreditCard* credit_card() { return &credit_card_; } |
52 | 52 |
53 private: | 53 private: |
54 // A copy of the card is owned by this object. | 54 // A copy of the card is owned by this object. |
55 autofill::CreditCard credit_card_; | 55 autofill::CreditCard credit_card_; |
56 // Not owned by this object, should outlive this. | 56 // Not owned by this object, should outlive this. |
57 const std::vector<autofill::AutofillProfile*>& billing_profiles_; | 57 const std::vector<autofill::AutofillProfile*>& billing_profiles_; |
58 | 58 |
59 const std::string app_locale_; | 59 const std::string app_locale_; |
60 | 60 |
61 PaymentInstrument::Delegate* delegate_; | 61 PaymentInstrument::Delegate* delegate_; |
62 PaymentRequestDelegate* payment_request_delegate_; | 62 PaymentRequestDelegate* payment_request_delegate_; |
63 | 63 |
64 base::WeakPtrFactory<AutofillPaymentInstrument> weak_ptr_factory_; | 64 base::WeakPtrFactory<AutofillPaymentInstrument> weak_ptr_factory_; |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(AutofillPaymentInstrument); | 66 DISALLOW_COPY_AND_ASSIGN(AutofillPaymentInstrument); |
67 }; | 67 }; |
68 | 68 |
69 } // namespace payments | 69 } // namespace payments |
70 | 70 |
71 #endif // COMPONENTS_PAYMENTS_CORE_AUTOFILL_PAYMENT_INSTRUMENT_H_ | 71 #endif // COMPONENTS_PAYMENTS_CORE_AUTOFILL_PAYMENT_INSTRUMENT_H_ |
OLD | NEW |