| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // Returns whether the user has at least one instrument that satisfies the | 89 // Returns whether the user has at least one instrument that satisfies the |
| 90 // specified supported payment methods. | 90 // specified supported payment methods. |
| 91 bool CanMakePayment() const; | 91 bool CanMakePayment() const; |
| 92 | 92 |
| 93 // Returns true if the payment methods that the merchant website have | 93 // Returns true if the payment methods that the merchant website have |
| 94 // requested are supported. For example, may return true for "basic-card", but | 94 // requested are supported. For example, may return true for "basic-card", but |
| 95 // false for "https://bobpay.com". | 95 // false for "https://bobpay.com". |
| 96 bool AreRequestedMethodsSupported() const; | 96 bool AreRequestedMethodsSupported() const; |
| 97 | 97 |
| 98 // Returns authenticated user email, or empty string. |
| 99 std::string GetAuthenticatedEmail() const; |
| 100 |
| 98 void AddObserver(Observer* observer); | 101 void AddObserver(Observer* observer); |
| 99 void RemoveObserver(Observer* observer); | 102 void RemoveObserver(Observer* observer); |
| 100 | 103 |
| 101 // Initiates the generation of the PaymentResponse. Callers should check | 104 // Initiates the generation of the PaymentResponse. Callers should check |
| 102 // |is_ready_to_pay|, which is inexpensive. | 105 // |is_ready_to_pay|, which is inexpensive. |
| 103 void GeneratePaymentResponse(); | 106 void GeneratePaymentResponse(); |
| 104 | 107 |
| 105 // Gets the Autofill Profile representing the shipping address or contact | 108 // Gets the Autofill Profile representing the shipping address or contact |
| 106 // information currently selected for this PaymentRequest flow. Can return | 109 // information currently selected for this PaymentRequest flow. Can return |
| 107 // null. | 110 // null. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 PaymentsProfileComparator profile_comparator_; | 222 PaymentsProfileComparator profile_comparator_; |
| 220 | 223 |
| 221 base::ObserverList<Observer> observers_; | 224 base::ObserverList<Observer> observers_; |
| 222 | 225 |
| 223 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); | 226 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); |
| 224 }; | 227 }; |
| 225 | 228 |
| 226 } // namespace payments | 229 } // namespace payments |
| 227 | 230 |
| 228 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ | 231 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ |
| OLD | NEW |