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