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 #include "components/payments/core/address_normalizer.h" | 5 #include "components/payments/core/address_normalizer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 it->second.push_back(std::move(request)); | 148 it->second.push_back(std::move(request)); |
149 | 149 |
150 // Start loading the rules for that region. If the rules were already in the | 150 // Start loading the rules for that region. If the rules were already in the |
151 // process of being loaded, this call will do nothing. | 151 // process of being loaded, this call will do nothing. |
152 LoadRulesForRegion(region_code); | 152 LoadRulesForRegion(region_code); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 void AddressNormalizer::OnAddressRulesLoaded(const std::string& region_code, | 156 void AddressNormalizer::OnAddressValidationRulesLoaded( |
157 bool success) { | 157 const std::string& region_code, |
| 158 bool success) { |
158 // Check if an address normalization is pending. | 159 // Check if an address normalization is pending. |
159 auto it = pending_normalization_.find(region_code); | 160 auto it = pending_normalization_.find(region_code); |
160 if (it != pending_normalization_.end()) { | 161 if (it != pending_normalization_.end()) { |
161 for (size_t i = 0; i < it->second.size(); ++i) { | 162 for (size_t i = 0; i < it->second.size(); ++i) { |
162 it->second[i]->OnRulesLoaded(success); | 163 it->second[i]->OnRulesLoaded(success); |
163 } | 164 } |
164 pending_normalization_.erase(it); | 165 pending_normalization_.erase(it); |
165 } | 166 } |
166 } | 167 } |
167 | 168 |
168 } // namespace payments | 169 } // namespace payments |
OLD | NEW |