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_CORE_ADDRESS_NORMALIZER_H_ | 5 #ifndef COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ |
6 #define COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ | 6 #define COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Will start loading the rules for the |region_code| if they had not started | 69 // Will start loading the rules for the |region_code| if they had not started |
70 // loading. | 70 // loading. |
71 void StartAddressNormalization(const autofill::AutofillProfile& profile, | 71 void StartAddressNormalization(const autofill::AutofillProfile& profile, |
72 const std::string& region_code, | 72 const std::string& region_code, |
73 int timeout_seconds, | 73 int timeout_seconds, |
74 Delegate* requester); | 74 Delegate* requester); |
75 | 75 |
76 private: | 76 private: |
77 // Called when the validation rules for the |region_code| have finished | 77 // Called when the validation rules for the |region_code| have finished |
78 // loading. Implementation of the LoadRulesListener interface. | 78 // loading. Implementation of the LoadRulesListener interface. |
79 void OnAddressValidationRulesLoaded(const std::string& region_code, | 79 void OnAddressRulesLoaded(const std::string& region_code, |
80 bool success) override; | 80 bool success) override; |
81 | 81 |
82 // Map associating a region code to pending normalizations. | 82 // Map associating a region code to pending normalizations. |
83 std::map<std::string, std::vector<std::unique_ptr<Request>>> | 83 std::map<std::string, std::vector<std::unique_ptr<Request>>> |
84 pending_normalization_; | 84 pending_normalization_; |
85 | 85 |
86 // The address validator used to normalize addresses. | 86 // The address validator used to normalize addresses. |
87 autofill::AddressValidator address_validator_; | 87 autofill::AddressValidator address_validator_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(AddressNormalizer); | 89 DISALLOW_COPY_AND_ASSIGN(AddressNormalizer); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace payments | 92 } // namespace payments |
93 | 93 |
94 #endif // COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ | 94 #endif // COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_H_ |
OLD | NEW |