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_REQUEST_STATE_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ |
6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ | 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
13 #include "components/payments/content/payment_request.mojom.h" | 13 #include "components/payments/content/payment_request.mojom.h" |
14 #include "components/payments/core/payment_instrument.h" | 14 #include "components/payments/core/payment_instrument.h" |
15 | 15 |
16 namespace autofill { | 16 namespace autofill { |
17 class AutofillProfile; | 17 class AutofillProfile; |
18 class PersonalDataManager; | 18 class PersonalDataManager; |
19 } // namespace autofill | 19 } // namespace autofill |
20 | 20 |
21 namespace payments { | 21 namespace payments { |
22 | 22 |
23 class PaymentRequestSpec; | 23 class PaymentRequestSpec; |
24 | 24 |
| 25 // Identifier for the BasicCard payment method. |
| 26 extern const char kBasicCardMethodName[]; |
| 27 |
25 // Keeps track of the information currently selected by the user and whether the | 28 // Keeps track of the information currently selected by the user and whether the |
26 // user is ready to pay. Uses information from the PaymentRequestSpec, which is | 29 // user is ready to pay. Uses information from the PaymentRequestSpec, which is |
27 // what the merchant has specified, as input into the "is ready to pay" | 30 // what the merchant has specified, as input into the "is ready to pay" |
28 // computation. | 31 // computation. |
29 class PaymentRequestState : public PaymentInstrument::Delegate { | 32 class PaymentRequestState : public PaymentInstrument::Delegate { |
30 public: | 33 public: |
31 // Any class call add itself as Observer via AddObserver() and receive | 34 // Any class call add itself as Observer via AddObserver() and receive |
32 // notification about the state changing. | 35 // notification about the state changing. |
33 class Observer { | 36 class Observer { |
34 public: | 37 public: |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 std::vector<std::unique_ptr<PaymentInstrument>> available_instruments_; | 175 std::vector<std::unique_ptr<PaymentInstrument>> available_instruments_; |
173 | 176 |
174 base::ObserverList<Observer> observers_; | 177 base::ObserverList<Observer> observers_; |
175 | 178 |
176 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); | 179 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); |
177 }; | 180 }; |
178 | 181 |
179 } // namespace payments | 182 } // namespace payments |
180 | 183 |
181 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ | 184 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ |
OLD | NEW |