OLD | NEW |
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 #include <algorithm> | 8 #include <algorithm> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
14 #include "base/i18n/case_conversion.h" | 14 #include "base/i18n/case_conversion.h" |
15 #include "base/i18n/timezone.h" | 15 #include "base/i18n/timezone.h" |
16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
17 #include "base/profiler/scoped_tracker.h" | 17 #include "base/profiler/scoped_tracker.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/strings/string_util.h" | 19 #include "base/strings/string_util.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
22 #include "components/autofill/core/browser/address_i18n.h" | 22 #include "components/autofill/core/browser/address_i18n.h" |
23 #include "components/autofill/core/browser/autofill-inl.h" | 23 #include "components/autofill/core/browser/autofill-inl.h" |
24 #include "components/autofill/core/browser/autofill_country.h" | 24 #include "components/autofill/core/browser/autofill_country.h" |
25 #include "components/autofill/core/browser/autofill_experiments.h" | 25 #include "components/autofill/core/browser/autofill_experiments.h" |
26 #include "components/autofill/core/browser/autofill_field.h" | 26 #include "components/autofill/core/browser/autofill_field.h" |
27 #include "components/autofill/core/browser/autofill_metrics.h" | 27 #include "components/autofill/core/browser/autofill_metrics.h" |
28 #include "components/autofill/core/browser/country_data.h" | 28 #include "components/autofill/core/browser/country_data.h" |
| 29 #include "components/autofill/core/browser/country_names.h" |
29 #include "components/autofill/core/browser/form_structure.h" | 30 #include "components/autofill/core/browser/form_structure.h" |
30 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 31 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
31 #include "components/autofill/core/browser/phone_number.h" | 32 #include "components/autofill/core/browser/phone_number.h" |
32 #include "components/autofill/core/browser/phone_number_i18n.h" | 33 #include "components/autofill/core/browser/phone_number_i18n.h" |
33 #include "components/autofill/core/browser/validation.h" | 34 #include "components/autofill/core/browser/validation.h" |
34 #include "components/autofill/core/common/autofill_pref_names.h" | 35 #include "components/autofill/core/common/autofill_pref_names.h" |
35 #include "components/autofill/core/common/autofill_switches.h" | 36 #include "components/autofill/core/common/autofill_switches.h" |
36 #include "components/autofill/core/common/autofill_util.h" | 37 #include "components/autofill/core/common/autofill_util.h" |
37 #include "components/signin/core/browser/account_tracker_service.h" | 38 #include "components/signin/core/browser/account_tracker_service.h" |
38 #include "components/signin/core/browser/signin_manager.h" | 39 #include "components/signin/core/browser/signin_manager.h" |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 pref_service_(NULL), | 212 pref_service_(NULL), |
212 account_tracker_(NULL), | 213 account_tracker_(NULL), |
213 is_off_the_record_(false), | 214 is_off_the_record_(false), |
214 has_logged_profile_count_(false) {} | 215 has_logged_profile_count_(false) {} |
215 | 216 |
216 void PersonalDataManager::Init(scoped_refptr<AutofillWebDataService> database, | 217 void PersonalDataManager::Init(scoped_refptr<AutofillWebDataService> database, |
217 PrefService* pref_service, | 218 PrefService* pref_service, |
218 AccountTrackerService* account_tracker, | 219 AccountTrackerService* account_tracker, |
219 SigninManagerBase* signin_manager, | 220 SigninManagerBase* signin_manager, |
220 bool is_off_the_record) { | 221 bool is_off_the_record) { |
| 222 CountryNames::SetLocaleString(app_locale_); |
| 223 |
221 database_ = database; | 224 database_ = database; |
222 SetPrefService(pref_service); | 225 SetPrefService(pref_service); |
223 account_tracker_ = account_tracker; | 226 account_tracker_ = account_tracker; |
224 signin_manager_ = signin_manager; | 227 signin_manager_ = signin_manager; |
225 is_off_the_record_ = is_off_the_record; | 228 is_off_the_record_ = is_off_the_record; |
226 | 229 |
227 if (!is_off_the_record_) | 230 if (!is_off_the_record_) |
228 AutofillMetrics::LogIsAutofillEnabledAtStartup(IsAutofillEnabled()); | 231 AutofillMetrics::LogIsAutofillEnabledAtStartup(IsAutofillEnabled()); |
229 | 232 |
230 // WebDataService may not be available in tests. | 233 // WebDataService may not be available in tests. |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 web_profiles().end()); | 1374 web_profiles().end()); |
1372 if (IsExperimentalWalletIntegrationEnabled() && | 1375 if (IsExperimentalWalletIntegrationEnabled() && |
1373 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { | 1376 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { |
1374 profiles_.insert( | 1377 profiles_.insert( |
1375 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1378 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
1376 } | 1379 } |
1377 return profiles_; | 1380 return profiles_; |
1378 } | 1381 } |
1379 | 1382 |
1380 } // namespace autofill | 1383 } // namespace autofill |
OLD | NEW |