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_CONTENT_PAYMENT_RESPONSE_HELPER_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_RESPONSE_HELPER_H_ |
6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_RESPONSE_HELPER_H_ | 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_RESPONSE_HELPER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/autofill/core/browser/autofill_profile.h" | 9 #include "components/autofill/core/browser/autofill_profile.h" |
10 #include "components/payments/core/address_normalizer.h" | 10 #include "components/payments/core/address_normalizer.h" |
11 #include "components/payments/core/payment_instrument.h" | 11 #include "components/payments/core/payment_instrument.h" |
12 #include "components/payments/mojom/payment_request.mojom.h" | 12 #include "components/payments/mojom/payment_request.mojom.h" |
13 | 13 |
14 namespace payments { | 14 namespace payments { |
15 | 15 |
16 class PaymentRequestDelegate; | 16 class PaymentRequestDelegate; |
17 class PaymentRequestSpec; | 17 class PaymentRequestSpec; |
18 | 18 |
19 // TODO(sebsg): Asynchronously normalize the billing and shipping addresses | 19 // TODO(sebsg): Asynchronously normalize the billing and shipping addresses |
20 // before adding them to the PaymentResponse. | 20 // before adding them to the PaymentResponse. |
21 // A helper class to facilitate the creation of the PaymentResponse. | 21 // A helper class to facilitate the creation of the PaymentResponse. |
22 class PaymentResponseHelper : public PaymentInstrument::Delegate, | 22 class PaymentResponseHelper : public PaymentInstrument::Delegate, |
23 AddressNormalizer::Delegate { | 23 public AddressNormalizer::Delegate { |
24 public: | 24 public: |
25 class Delegate { | 25 class Delegate { |
26 public: | 26 public: |
27 virtual ~Delegate() {} | 27 virtual ~Delegate() {} |
28 | 28 |
29 virtual void OnPaymentResponseReady( | 29 virtual void OnPaymentResponseReady( |
30 mojom::PaymentResponsePtr payment_response) = 0; | 30 mojom::PaymentResponsePtr payment_response) = 0; |
31 }; | 31 }; |
32 | 32 |
33 // The spec, selected_instrument and delegate cannot be null. | 33 // The spec, selected_instrument and delegate cannot be null. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // Instrument Details. | 79 // Instrument Details. |
80 std::string method_name_; | 80 std::string method_name_; |
81 std::string stringified_details_; | 81 std::string stringified_details_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(PaymentResponseHelper); | 83 DISALLOW_COPY_AND_ASSIGN(PaymentResponseHelper); |
84 }; | 84 }; |
85 | 85 |
86 } // namespace payments | 86 } // namespace payments |
87 | 87 |
88 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_RESPONSE_HELPER_H_ | 88 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_RESPONSE_HELPER_H_ |
OLD | NEW |