Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_IMPL_H_ | |
| 6 #define COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_IMPL_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <memory> | |
| 10 #include <vector> | |
|
please use gerrit instead
2017/04/21 15:09:31
#include <string>
sebsg
2017/04/21 15:17:48
Done.
| |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 #include "components/payments/core/address_normalizer.h" | |
| 14 | |
| 15 namespace autofill { | |
| 16 class AutofillProfile; | |
| 17 } | |
| 18 | |
| 19 namespace i18n { | |
| 20 namespace libadderssinput { | |
|
please use gerrit instead
2017/04/21 15:07:34
Still misspelled here.
sebsg
2017/04/21 15:17:48
Done.
| |
| 21 class Source; | |
| 22 class Storage; | |
| 23 } | |
| 24 } | |
| 25 | |
| 26 namespace payments { | |
| 27 | |
| 28 // A class used to normalize addresses. | |
| 29 class AddressNormalizerImpl : public AddressNormalizer { | |
| 30 public: | |
| 31 AddressNormalizerImpl(std::unique_ptr<::i18n::addressinput::Source> source, | |
| 32 std::unique_ptr<::i18n::addressinput::Storage> storage); | |
| 33 ~AddressNormalizerImpl() override; | |
| 34 | |
| 35 // AddressNormalizer implementation. | |
| 36 void LoadRulesForRegion(const std::string& region_code) override; | |
| 37 bool AreRulesLoadedForRegion(const std::string& region_code) override; | |
| 38 void StartAddressNormalization(const autofill::AutofillProfile& profile, | |
| 39 const std::string& region_code, | |
| 40 int timeout_seconds, | |
| 41 Delegate* requester) override; | |
| 42 | |
| 43 private: | |
| 44 // Called when the validation rules for the |region_code| have finished | |
| 45 // loading. Implementation of the LoadRulesListener interface. | |
| 46 void OnAddressValidationRulesLoaded(const std::string& region_code, | |
| 47 bool success) override; | |
| 48 | |
| 49 // Map associating a region code to pending normalizations. | |
| 50 std::map<std::string, std::vector<std::unique_ptr<Request>>> | |
| 51 pending_normalization_; | |
| 52 | |
| 53 // The address validator used to normalize addresses. | |
| 54 autofill::AddressValidator address_validator_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(AddressNormalizerImpl); | |
| 57 }; | |
| 58 | |
| 59 } // namespace payments | |
| 60 | |
| 61 #endif // COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_IMPL_H_ | |
| OLD | NEW |