| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "components/payments/content/payment_request_spec.h" | 5 #include "components/payments/content/payment_request_spec.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 auto card_it = card_networks.find(networks[supported_network]); | 117 auto card_it = card_networks.find(networks[supported_network]); |
| 118 if (card_it != card_networks.end()) { | 118 if (card_it != card_networks.end()) { |
| 119 supported_card_networks_.push_back(networks[supported_network]); | 119 supported_card_networks_.push_back(networks[supported_network]); |
| 120 card_networks.erase(card_it); | 120 card_networks.erase(card_it); |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 |
| 128 supported_card_networks_set_.insert(supported_card_networks_.begin(), |
| 129 supported_card_networks_.end()); |
| 127 } | 130 } |
| 128 | 131 |
| 129 void PaymentRequestSpec::NotifyOnInvalidSpecProvided() { | 132 void PaymentRequestSpec::NotifyOnInvalidSpecProvided() { |
| 130 for (auto& observer : observers_) | 133 for (auto& observer : observers_) |
| 131 observer.OnInvalidSpecProvided(); | 134 observer.OnInvalidSpecProvided(); |
| 132 } | 135 } |
| 133 | 136 |
| 134 CurrencyFormatter* PaymentRequestSpec::GetOrCreateCurrencyFormatter( | 137 CurrencyFormatter* PaymentRequestSpec::GetOrCreateCurrencyFormatter( |
| 135 const std::string& currency_code, | 138 const std::string& currency_code, |
| 136 const std::string& currency_system, | 139 const std::string& currency_system, |
| 137 const std::string& locale_name) { | 140 const std::string& locale_name) { |
| 138 if (!currency_formatter_) { | 141 if (!currency_formatter_) { |
| 139 currency_formatter_.reset( | 142 currency_formatter_.reset( |
| 140 new CurrencyFormatter(currency_code, currency_system, locale_name)); | 143 new CurrencyFormatter(currency_code, currency_system, locale_name)); |
| 141 } | 144 } |
| 142 return currency_formatter_.get(); | 145 return currency_formatter_.get(); |
| 143 } | 146 } |
| 144 | 147 |
| 145 } // namespace payments | 148 } // namespace payments |
| OLD | NEW |