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 <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 DCHECK(pref_service_); | 968 DCHECK(pref_service_); |
969 return pref_service_->GetBoolean(prefs::kAutofillEnabled); | 969 return pref_service_->GetBoolean(prefs::kAutofillEnabled); |
970 } | 970 } |
971 | 971 |
972 std::string PersonalDataManager::CountryCodeForCurrentTimezone() const { | 972 std::string PersonalDataManager::CountryCodeForCurrentTimezone() const { |
973 return base::CountryCodeForCurrentTimezone(); | 973 return base::CountryCodeForCurrentTimezone(); |
974 } | 974 } |
975 | 975 |
976 void PersonalDataManager::SetPrefService(PrefService* pref_service) { | 976 void PersonalDataManager::SetPrefService(PrefService* pref_service) { |
977 enabled_pref_.reset(new BooleanPrefMember); | 977 enabled_pref_.reset(new BooleanPrefMember); |
| 978 wallet_enabled_pref_.reset(new BooleanPrefMember); |
978 pref_service_ = pref_service; | 979 pref_service_ = pref_service; |
979 // |pref_service_| can be NULL in tests. | 980 // |pref_service_| can be NULL in tests. |
980 if (pref_service_) { | 981 if (pref_service_) { |
981 enabled_pref_->Init(prefs::kAutofillEnabled, pref_service_, | 982 enabled_pref_->Init(prefs::kAutofillEnabled, pref_service_, |
982 base::Bind(&PersonalDataManager::EnabledPrefChanged, | 983 base::Bind(&PersonalDataManager::EnabledPrefChanged, |
983 base::Unretained(this))); | 984 base::Unretained(this))); |
| 985 wallet_enabled_pref_->Init(prefs::kAutofillWalletImportEnabled, |
| 986 pref_service_, |
| 987 base::Bind(&PersonalDataManager::EnabledPrefChanged, |
| 988 base::Unretained(this))); |
984 } | 989 } |
985 } | 990 } |
986 | 991 |
987 // static | 992 // static |
988 bool PersonalDataManager::IsValidLearnableProfile( | 993 bool PersonalDataManager::IsValidLearnableProfile( |
989 const AutofillProfile& profile, | 994 const AutofillProfile& profile, |
990 const std::string& app_locale) { | 995 const std::string& app_locale) { |
991 if (!IsMinimumAddress(profile, app_locale)) | 996 if (!IsMinimumAddress(profile, app_locale)) |
992 return false; | 997 return false; |
993 | 998 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 } | 1355 } |
1351 if (IsExperimentalWalletIntegrationEnabled() && | 1356 if (IsExperimentalWalletIntegrationEnabled() && |
1352 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { | 1357 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { |
1353 profiles_.insert( | 1358 profiles_.insert( |
1354 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1359 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
1355 } | 1360 } |
1356 return profiles_; | 1361 return profiles_; |
1357 } | 1362 } |
1358 | 1363 |
1359 } // namespace autofill | 1364 } // namespace autofill |
OLD | NEW |