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

Side by Side Diff: components/autofill/core/browser/personal_data_manager.h

Issue 2338283003: [Payments] Normalize addresses before passing them to merchants. (Closed)
Patch Set: import order Created 4 years, 2 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/scoped_vector.h" 14 #include "base/memory/scoped_vector.h"
15 #include "base/observer_list.h" 15 #include "base/observer_list.h"
16 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
17 #include "build/build_config.h" 17 #include "build/build_config.h"
18 #include "components/autofill/core/browser/autofill_profile.h" 18 #include "components/autofill/core/browser/autofill_profile.h"
19 #include "components/autofill/core/browser/credit_card.h" 19 #include "components/autofill/core/browser/credit_card.h"
20 #include "components/autofill/core/browser/field_types.h" 20 #include "components/autofill/core/browser/field_types.h"
21 #include "components/autofill/core/browser/suggestion.h" 21 #include "components/autofill/core/browser/suggestion.h"
22 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 22 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
23 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse rver.h" 23 #include "components/autofill/core/browser/webdata/autofill_webdata_service_obse rver.h"
24 #include "components/keyed_service/core/keyed_service.h" 24 #include "components/keyed_service/core/keyed_service.h"
25 #include "components/prefs/pref_member.h" 25 #include "components/prefs/pref_member.h"
26 #include "components/webdata/common/web_data_service_consumer.h" 26 #include "components/webdata/common/web_data_service_consumer.h"
27 #if defined(OS_ANDROID)
28 #include "net/url_request/url_request_context_getter.h"
29 #endif
27 30
28 class AccountTrackerService; 31 class AccountTrackerService;
29 class Browser; 32 class Browser;
30 class PrefService; 33 class PrefService;
31 class RemoveAutofillTester; 34 class RemoveAutofillTester;
32 class SigninManagerBase; 35 class SigninManagerBase;
33 36
34 namespace sync_driver { 37 namespace sync_driver {
35 class SyncService; 38 class SyncService;
36 } 39 }
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 // local duplicates, and local cards are preferred over their masked server 256 // local duplicates, and local cards are preferred over their masked server
254 // card duplicate. 257 // card duplicate.
255 static void DedupeCreditCardToSuggest( 258 static void DedupeCreditCardToSuggest(
256 std::list<CreditCard*>* cards_to_suggest); 259 std::list<CreditCard*>* cards_to_suggest);
257 260
258 // Notifies test observers that personal data has changed. 261 // Notifies test observers that personal data has changed.
259 void NotifyPersonalDataChangedForTest() { 262 void NotifyPersonalDataChangedForTest() {
260 NotifyPersonalDataChanged(); 263 NotifyPersonalDataChanged();
261 } 264 }
262 265
266 #if defined(OS_ANDROID)
267 // Sets the URL request context getter to be used when normalizing addresses
268 // with libaddressinput's address validator.
269 void SetURLRequestContextGetter(
270 net::URLRequestContextGetter* context_getter) {
271 context_getter_ = context_getter;
272 }
273
274 // Returns the class used to fetch the address validation rules.
275 net::URLRequestContextGetter* GetURLRequestContextGetter() const {
276 return context_getter_.get();
277 }
278 #endif
279
263 protected: 280 protected:
264 // Only PersonalDataManagerFactory and certain tests can create instances of 281 // Only PersonalDataManagerFactory and certain tests can create instances of
265 // PersonalDataManager. 282 // PersonalDataManager.
266 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FirstMiddleLast); 283 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, FirstMiddleLast);
267 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtStartup); 284 FRIEND_TEST_ALL_PREFIXES(AutofillMetricsTest, AutofillIsEnabledAtStartup);
268 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, 285 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
269 DedupeProfiles_ProfilesToDelete); 286 DedupeProfiles_ProfilesToDelete);
270 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, ApplyProfileUseDatesFix); 287 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, ApplyProfileUseDatesFix);
271 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, 288 FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
272 ApplyProfileUseDatesFix_NotAppliedTwice); 289 ApplyProfileUseDatesFix_NotAppliedTwice);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // An observer to listen for changes to prefs::kAutofillEnabled. 503 // An observer to listen for changes to prefs::kAutofillEnabled.
487 std::unique_ptr<BooleanPrefMember> enabled_pref_; 504 std::unique_ptr<BooleanPrefMember> enabled_pref_;
488 505
489 // An observer to listen for changes to prefs::kAutofillWalletImportEnabled. 506 // An observer to listen for changes to prefs::kAutofillWalletImportEnabled.
490 std::unique_ptr<BooleanPrefMember> wallet_enabled_pref_; 507 std::unique_ptr<BooleanPrefMember> wallet_enabled_pref_;
491 508
492 // Set to true if autofill profile deduplication is enabled and needs to be 509 // Set to true if autofill profile deduplication is enabled and needs to be
493 // performed on the next data refresh. 510 // performed on the next data refresh.
494 bool is_autofill_profile_dedupe_pending_ = false; 511 bool is_autofill_profile_dedupe_pending_ = false;
495 512
513 #if defined(OS_ANDROID)
514 // The context for the request to be used to fetch libaddressinput's address
515 // validation rules.
516 scoped_refptr<net::URLRequestContextGetter> context_getter_;
517 #endif
518
496 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager); 519 DISALLOW_COPY_AND_ASSIGN(PersonalDataManager);
497 }; 520 };
498 521
499 } // namespace autofill 522 } // namespace autofill
500 523
501 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_ 524 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_PERSONAL_DATA_MANAGER_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_manager.cc ('k') | third_party/libaddressinput/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698