Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: components/payments/core/address_normalizer_impl.h

Issue 2829903004: Reland: Normalize shipping address for merchant on Desktop. (Closed)
Patch Set: Make android code use the new impl Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 <string>
11 #include <vector>
12
13 #include "base/macros.h"
14 #include "components/payments/core/address_normalizer.h"
15
16 namespace autofill {
17 class AutofillProfile;
18 }
19
20 namespace i18n {
21 namespace addressinput {
22 class Source;
23 class Storage;
24 }
25 }
26
27 namespace payments {
28
29 // A class used to normalize addresses.
30 class AddressNormalizerImpl : public AddressNormalizer {
31 public:
32 AddressNormalizerImpl(std::unique_ptr<::i18n::addressinput::Source> source,
33 std::unique_ptr<::i18n::addressinput::Storage> storage);
34 ~AddressNormalizerImpl() override;
35
36 // AddressNormalizer implementation.
37 void LoadRulesForRegion(const std::string& region_code) override;
38 bool AreRulesLoadedForRegion(const std::string& region_code) override;
39 void StartAddressNormalization(const autofill::AutofillProfile& profile,
40 const std::string& region_code,
41 int timeout_seconds,
42 Delegate* requester) override;
43
44 private:
45 // Called when the validation rules for the |region_code| have finished
46 // loading. Implementation of the LoadRulesListener interface.
47 void OnAddressValidationRulesLoaded(const std::string& region_code,
48 bool success) override;
49
50 // Map associating a region code to pending normalizations.
51 std::map<std::string, std::vector<std::unique_ptr<Request>>>
52 pending_normalization_;
53
54 // The address validator used to normalize addresses.
55 autofill::AddressValidator address_validator_;
56
57 DISALLOW_COPY_AND_ASSIGN(AddressNormalizerImpl);
58 };
59
60 } // namespace payments
61
62 #endif // COMPONENTS_PAYMENTS_CORE_ADDRESS_NORMALIZER_IMPL_H_
OLDNEW
« no previous file with comments | « components/payments/core/address_normalizer.cc ('k') | components/payments/core/address_normalizer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698