| 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_SPEC_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_ |
| 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_ | 6 #define COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const mojom::PaymentCurrencyAmountPtr& currency_amount); | 93 const mojom::PaymentCurrencyAmountPtr& currency_amount); |
| 94 | 94 |
| 95 // Uses CurrencyFormatter to get the formatted currency code for | 95 // Uses CurrencyFormatter to get the formatted currency code for |
| 96 // |currency_amount|'s currency. | 96 // |currency_amount|'s currency. |
| 97 std::string GetFormattedCurrencyCode( | 97 std::string GetFormattedCurrencyCode( |
| 98 const mojom::PaymentCurrencyAmountPtr& currency_amount); | 98 const mojom::PaymentCurrencyAmountPtr& currency_amount); |
| 99 | 99 |
| 100 mojom::PaymentShippingOption* selected_shipping_option() const { | 100 mojom::PaymentShippingOption* selected_shipping_option() const { |
| 101 return selected_shipping_option_; | 101 return selected_shipping_option_; |
| 102 } | 102 } |
| 103 // if |selected_shipping_option()| is nullptr, this may contain a non-empty | 103 // This may contain a non-empty error returned by the merchant. In this case |
| 104 // error returned by the merchant. | 104 // PaymentRequestState::selected_shipping_option_error_profile() will contain |
| 105 // the profile related to the error. |
| 105 const base::string16& selected_shipping_option_error() const { | 106 const base::string16& selected_shipping_option_error() const { |
| 106 return selected_shipping_option_error_; | 107 return selected_shipping_option_error_; |
| 107 } | 108 } |
| 108 | 109 |
| 109 const mojom::PaymentDetails& details() const { return *details_.get(); } | 110 const mojom::PaymentDetails& details() const { return *details_.get(); } |
| 110 | 111 |
| 111 void StartWaitingForUpdateWith(UpdateReason reason); | 112 void StartWaitingForUpdateWith(UpdateReason reason); |
| 112 | 113 |
| 113 bool IsMixedCurrency() const; | 114 bool IsMixedCurrency() const; |
| 114 | 115 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // The |observer_for_testing_| will fire after all the |observers_| have been | 171 // The |observer_for_testing_| will fire after all the |observers_| have been |
| 171 // notified. | 172 // notified. |
| 172 base::ObserverList<Observer> observers_; | 173 base::ObserverList<Observer> observers_; |
| 173 | 174 |
| 174 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSpec); | 175 DISALLOW_COPY_AND_ASSIGN(PaymentRequestSpec); |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 } // namespace payments | 178 } // namespace payments |
| 178 | 179 |
| 179 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_ | 180 #endif // COMPONENTS_PAYMENTS_CONTENT_PAYMENT_REQUEST_SPEC_H_ |
| OLD | NEW |