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

Side by Side Diff: third_party/libaddressinput/chromium/preload_address_validator.h

Issue 298863012: Use upstream libaddressinput in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review. Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_PRELOAD_ADDRESS_VALIDATOR_H_ 5 #ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_PRELOAD_ADDRESS_VALIDATOR_H_
6 #define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_PRELOAD_ADDRESS_VALIDATOR_H_ 6 #define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_PRELOAD_ADDRESS_VALIDATOR_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fi eld.h" 14 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fi eld.h"
15 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_va lidator.h" 15 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_va lidator.h"
16 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/callback.h " 16 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/callback.h "
17 17
18 namespace i18n { 18 namespace i18n {
19 namespace addressinput { 19 namespace addressinput {
20 20 class AddressNormalizer;
21 class Downloader; 21 class Downloader;
22 class PreloadSupplier; 22 class PreloadSupplier;
23 class Storage; 23 class Storage;
24 class Synonyms;
25 struct AddressData; 24 struct AddressData;
26 25 struct AddressInputHelper;
27 } // namespace addressinput 26 }
28 } // namespace i18n 27 }
29 28
30 namespace autofill { 29 namespace autofill {
31 30
32 class Suggestions; 31 class Suggestions;
33 32
34 // Interface to the libaddressinput AddressValidator for Chromium Autofill. 33 // Interface to the libaddressinput AddressValidator for Chromium Autofill.
35 class PreloadAddressValidator { 34 class PreloadAddressValidator {
36 public: 35 public:
37 typedef ::i18n::addressinput::Callback<std::string, int> Callback; 36 typedef ::i18n::addressinput::Callback<std::string, int> Callback;
38 37
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 virtual bool CanonicalizeAdministrativeArea( 117 virtual bool CanonicalizeAdministrativeArea(
119 ::i18n::addressinput::AddressData* address) const; 118 ::i18n::addressinput::AddressData* address) const;
120 119
121 private: 120 private:
122 void Validated(bool success, 121 void Validated(bool success,
123 const ::i18n::addressinput::AddressData&, 122 const ::i18n::addressinput::AddressData&,
124 const ::i18n::addressinput::FieldProblemMap&); 123 const ::i18n::addressinput::FieldProblemMap&);
125 124
126 const scoped_ptr< ::i18n::addressinput::PreloadSupplier> supplier_; 125 const scoped_ptr< ::i18n::addressinput::PreloadSupplier> supplier_;
127 const scoped_ptr<Suggestions> suggestions_; 126 const scoped_ptr<Suggestions> suggestions_;
128 const scoped_ptr< ::i18n::addressinput::Synonyms> synonyms_; 127 const scoped_ptr< ::i18n::addressinput::AddressNormalizer> normalizer_;
129 const scoped_ptr<const ::i18n::addressinput::AddressValidator> validator_; 128 const scoped_ptr<const ::i18n::addressinput::AddressValidator> validator_;
129 const scoped_ptr<const ::i18n::addressinput::AddressInputHelper>
130 input_helper_;
130 const scoped_ptr<const ::i18n::addressinput::AddressValidator::Callback> 131 const scoped_ptr<const ::i18n::addressinput::AddressValidator::Callback>
131 validated_; 132 validated_;
132 133
133 friend class MockAddressValidator; 134 friend class MockAddressValidator;
134 PreloadAddressValidator(); 135 PreloadAddressValidator();
135 136
136 DISALLOW_COPY_AND_ASSIGN(PreloadAddressValidator); 137 DISALLOW_COPY_AND_ASSIGN(PreloadAddressValidator);
137 }; 138 };
138 139
139 } // namespace autofill 140 } // namespace autofill
140 141
141 #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_PRELOAD_ADDRESS_VALIDATOR_H_ 142 #endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_PRELOAD_ADDRESS_VALIDATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698