| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 available_instruments() { | 123 available_instruments() { |
| 124 return available_instruments_; | 124 return available_instruments_; |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Creates and adds an AutofillPaymentInstrument, which makes a copy of | 127 // Creates and adds an AutofillPaymentInstrument, which makes a copy of |
| 128 // |card|. |selected| indicates if the newly-created instrument should be | 128 // |card|. |selected| indicates if the newly-created instrument should be |
| 129 // selected, after which observers will be notified. | 129 // selected, after which observers will be notified. |
| 130 void AddAutofillPaymentInstrument(bool selected, | 130 void AddAutofillPaymentInstrument(bool selected, |
| 131 const autofill::CreditCard& card); | 131 const autofill::CreditCard& card); |
| 132 | 132 |
| 133 // Creates and adds an AutofillProfile as a shipping profile, which makes a |
| 134 // copy of |profile|. |selected| indicates if the newly-created shipping |
| 135 // profile should be selected, after which observers will be notified. |
| 136 void AddAutofillShippingProfile(bool selected, |
| 137 const autofill::AutofillProfile& profile); |
| 138 |
| 133 // Setters to change the selected information. Will have the side effect of | 139 // Setters to change the selected information. Will have the side effect of |
| 134 // recomputing "is ready to pay" and notify observers. | 140 // recomputing "is ready to pay" and notify observers. |
| 135 void SetSelectedShippingOption(const std::string& shipping_option_id); | 141 void SetSelectedShippingOption(const std::string& shipping_option_id); |
| 136 void SetSelectedShippingProfile(autofill::AutofillProfile* profile); | 142 void SetSelectedShippingProfile(autofill::AutofillProfile* profile); |
| 137 void SetSelectedContactProfile(autofill::AutofillProfile* profile); | 143 void SetSelectedContactProfile(autofill::AutofillProfile* profile); |
| 138 void SetSelectedInstrument(PaymentInstrument* instrument); | 144 void SetSelectedInstrument(PaymentInstrument* instrument); |
| 139 | 145 |
| 140 bool is_ready_to_pay() { return is_ready_to_pay_; } | 146 bool is_ready_to_pay() { return is_ready_to_pay_; } |
| 141 | 147 |
| 142 const std::string& GetApplicationLocale(); | 148 const std::string& GetApplicationLocale(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 std::unique_ptr<PaymentResponseHelper> response_helper_; | 204 std::unique_ptr<PaymentResponseHelper> response_helper_; |
| 199 | 205 |
| 200 base::ObserverList<Observer> observers_; | 206 base::ObserverList<Observer> observers_; |
| 201 | 207 |
| 202 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); | 208 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); |
| 203 }; | 209 }; |
| 204 | 210 |
| 205 } // namespace payments | 211 } // namespace payments |
| 206 | 212 |
| 207 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ | 213 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ |
| OLD | NEW |