| 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> |
| 9 #include <vector> |
| 10 |
| 8 #include "base/macros.h" | 11 #include "base/macros.h" |
| 9 #include "base/observer_list.h" | 12 #include "base/observer_list.h" |
| 10 #include "components/payments/content/payment_request.mojom.h" | 13 #include "components/payments/content/payment_request.mojom.h" |
| 11 #include "components/payments/core/payment_instrument.h" | 14 #include "components/payments/core/payment_instrument.h" |
| 12 | 15 |
| 13 namespace autofill { | 16 namespace autofill { |
| 14 class AutofillProfile; | 17 class AutofillProfile; |
| 15 class PersonalDataManager; | 18 class PersonalDataManager; |
| 16 } // namespace autofill | 19 } // namespace autofill |
| 17 | 20 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const std::vector<autofill::AutofillProfile*>& contact_profiles() { | 96 const std::vector<autofill::AutofillProfile*>& contact_profiles() { |
| 94 return contact_profiles_; | 97 return contact_profiles_; |
| 95 } | 98 } |
| 96 const std::vector<std::unique_ptr<PaymentInstrument>>& | 99 const std::vector<std::unique_ptr<PaymentInstrument>>& |
| 97 available_instruments() { | 100 available_instruments() { |
| 98 return available_instruments_; | 101 return available_instruments_; |
| 99 } | 102 } |
| 100 | 103 |
| 101 // Setters to change the selected information. Will have the side effect of | 104 // Setters to change the selected information. Will have the side effect of |
| 102 // recomputing "is ready to pay" and notify observers. | 105 // recomputing "is ready to pay" and notify observers. |
| 106 void SetSelectedShippingOption(mojom::PaymentShippingOption* option); |
| 103 void SetSelectedShippingProfile(autofill::AutofillProfile* profile); | 107 void SetSelectedShippingProfile(autofill::AutofillProfile* profile); |
| 104 void SetSelectedContactProfile(autofill::AutofillProfile* profile); | 108 void SetSelectedContactProfile(autofill::AutofillProfile* profile); |
| 105 void SetSelectedInstrument(PaymentInstrument* instrument); | 109 void SetSelectedInstrument(PaymentInstrument* instrument); |
| 106 | 110 |
| 107 bool is_ready_to_pay() { return is_ready_to_pay_; } | 111 bool is_ready_to_pay() { return is_ready_to_pay_; } |
| 108 | 112 |
| 109 const std::string& GetApplicationLocale(); | 113 const std::string& GetApplicationLocale(); |
| 110 autofill::PersonalDataManager* GetPersonalDataManager(); | 114 autofill::PersonalDataManager* GetPersonalDataManager(); |
| 111 | 115 |
| 112 private: | 116 private: |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 std::vector<std::unique_ptr<PaymentInstrument>> available_instruments_; | 169 std::vector<std::unique_ptr<PaymentInstrument>> available_instruments_; |
| 166 | 170 |
| 167 base::ObserverList<Observer> observers_; | 171 base::ObserverList<Observer> observers_; |
| 168 | 172 |
| 169 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); | 173 DISALLOW_COPY_AND_ASSIGN(PaymentRequestState); |
| 170 }; | 174 }; |
| 171 | 175 |
| 172 } // namespace payments | 176 } // namespace payments |
| 173 | 177 |
| 174 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ | 178 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_STATE_H_ |
| OLD | NEW |