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

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

Issue 2829903004: Reland: Normalize shipping address for merchant on Desktop. (Closed)
Patch Set: Created an interface for the AddressNormalizer for better testing 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 <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_
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