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

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

Issue 2338283003: [Payments] Normalize addresses before passing them to merchants. (Closed)
Patch Set: Created 4 years, 3 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 #include "components/autofill/core/browser/personal_data_manager.h" 5 #include "components/autofill/core/browser/personal_data_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 25 matching lines...) Expand all
36 #include "components/autofill/core/common/autofill_pref_names.h" 36 #include "components/autofill/core/common/autofill_pref_names.h"
37 #include "components/autofill/core/common/autofill_switches.h" 37 #include "components/autofill/core/common/autofill_switches.h"
38 #include "components/autofill/core/common/autofill_util.h" 38 #include "components/autofill/core/common/autofill_util.h"
39 #include "components/prefs/pref_service.h" 39 #include "components/prefs/pref_service.h"
40 #include "components/signin/core/browser/account_tracker_service.h" 40 #include "components/signin/core/browser/account_tracker_service.h"
41 #include "components/signin/core/browser/signin_manager.h" 41 #include "components/signin/core/browser/signin_manager.h"
42 #include "components/signin/core/common/signin_pref_names.h" 42 #include "components/signin/core/common/signin_pref_names.h"
43 #include "components/sync/driver/sync_service.h" 43 #include "components/sync/driver/sync_service.h"
44 #include "components/variations/variations_associated_data.h" 44 #include "components/variations/variations_associated_data.h"
45 #include "components/version_info/version_info.h" 45 #include "components/version_info/version_info.h"
46 #include "net/url_request/url_request_context_getter.h"
46 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da ta.h" 47 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_da ta.h"
47 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fo rmatter.h" 48 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fo rmatter.h"
48 49
49 namespace autofill { 50 namespace autofill {
50 namespace { 51 namespace {
51 52
52 using ::i18n::addressinput::AddressField; 53 using ::i18n::addressinput::AddressField;
53 using ::i18n::addressinput::GetStreetAddressLinesAsSingleLine; 54 using ::i18n::addressinput::GetStreetAddressLinesAsSingleLine;
54 using ::i18n::addressinput::STREET_ADDRESS; 55 using ::i18n::addressinput::STREET_ADDRESS;
55 56
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 245 }
245 246
246 return false; 247 return false;
247 } 248 }
248 249
249 } // namespace 250 } // namespace
250 251
251 const char kFrecencyFieldTrialName[] = "AutofillProfileOrderByFrecency"; 252 const char kFrecencyFieldTrialName[] = "AutofillProfileOrderByFrecency";
252 const char kFrecencyFieldTrialLimitParam[] = "limit"; 253 const char kFrecencyFieldTrialLimitParam[] = "limit";
253 254
254 PersonalDataManager::PersonalDataManager(const std::string& app_locale) 255 PersonalDataManager::PersonalDataManager(
256 const std::string& app_locale,
257 net::URLRequestContextGetter* context_getter)
255 : database_(NULL), 258 : database_(NULL),
256 is_data_loaded_(false), 259 is_data_loaded_(false),
257 pending_profiles_query_(0), 260 pending_profiles_query_(0),
258 pending_server_profiles_query_(0), 261 pending_server_profiles_query_(0),
259 pending_creditcards_query_(0), 262 pending_creditcards_query_(0),
260 pending_server_creditcards_query_(0), 263 pending_server_creditcards_query_(0),
261 app_locale_(app_locale), 264 app_locale_(app_locale),
262 pref_service_(NULL), 265 pref_service_(NULL),
263 account_tracker_(NULL), 266 account_tracker_(NULL),
264 is_off_the_record_(false), 267 is_off_the_record_(false),
265 has_logged_profile_count_(false), 268 has_logged_profile_count_(false),
266 has_logged_credit_card_count_(false) {} 269 has_logged_credit_card_count_(false),
270 context_getter_(context_getter) {}
267 271
268 void PersonalDataManager::Init(scoped_refptr<AutofillWebDataService> database, 272 void PersonalDataManager::Init(scoped_refptr<AutofillWebDataService> database,
269 PrefService* pref_service, 273 PrefService* pref_service,
270 AccountTrackerService* account_tracker, 274 AccountTrackerService* account_tracker,
271 SigninManagerBase* signin_manager, 275 SigninManagerBase* signin_manager,
272 bool is_off_the_record) { 276 bool is_off_the_record) {
273 CountryNames::SetLocaleString(app_locale_); 277 CountryNames::SetLocaleString(app_locale_);
274 278
275 database_ = database; 279 database_ = database;
276 SetPrefService(pref_service); 280 SetPrefService(pref_service);
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 if (profile_to_merge->IsVerified()) 1760 if (profile_to_merge->IsVerified())
1757 break; 1761 break;
1758 } 1762 }
1759 } 1763 }
1760 } 1764 }
1761 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( 1765 AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe(
1762 profiles_to_delete->size()); 1766 profiles_to_delete->size());
1763 } 1767 }
1764 1768
1765 } // namespace autofill 1769 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698