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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 DCHECK(pref_service_); | 975 DCHECK(pref_service_); |
976 return pref_service_->GetBoolean(prefs::kAutofillEnabled); | 976 return pref_service_->GetBoolean(prefs::kAutofillEnabled); |
977 } | 977 } |
978 | 978 |
979 std::string PersonalDataManager::CountryCodeForCurrentTimezone() const { | 979 std::string PersonalDataManager::CountryCodeForCurrentTimezone() const { |
980 return base::CountryCodeForCurrentTimezone(); | 980 return base::CountryCodeForCurrentTimezone(); |
981 } | 981 } |
982 | 982 |
983 void PersonalDataManager::SetPrefService(PrefService* pref_service) { | 983 void PersonalDataManager::SetPrefService(PrefService* pref_service) { |
984 enabled_pref_.reset(new BooleanPrefMember); | 984 enabled_pref_.reset(new BooleanPrefMember); |
| 985 wallet_enabled_pref_.reset(new BooleanPrefMember); |
985 pref_service_ = pref_service; | 986 pref_service_ = pref_service; |
986 // |pref_service_| can be NULL in tests. | 987 // |pref_service_| can be NULL in tests. |
987 if (pref_service_) { | 988 if (pref_service_) { |
988 enabled_pref_->Init(prefs::kAutofillEnabled, pref_service_, | 989 enabled_pref_->Init(prefs::kAutofillEnabled, pref_service_, |
989 base::Bind(&PersonalDataManager::EnabledPrefChanged, | 990 base::Bind(&PersonalDataManager::EnabledPrefChanged, |
990 base::Unretained(this))); | 991 base::Unretained(this))); |
| 992 wallet_enabled_pref_->Init(prefs::kAutofillWalletImportEnabled, |
| 993 pref_service_, |
| 994 base::Bind(&PersonalDataManager::EnabledPrefChanged, |
| 995 base::Unretained(this))); |
991 } | 996 } |
992 } | 997 } |
993 | 998 |
994 // static | 999 // static |
995 bool PersonalDataManager::IsValidLearnableProfile( | 1000 bool PersonalDataManager::IsValidLearnableProfile( |
996 const AutofillProfile& profile, | 1001 const AutofillProfile& profile, |
997 const std::string& app_locale) { | 1002 const std::string& app_locale) { |
998 if (!IsMinimumAddress(profile, app_locale)) | 1003 if (!IsMinimumAddress(profile, app_locale)) |
999 return false; | 1004 return false; |
1000 | 1005 |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 } | 1362 } |
1358 if (IsExperimentalWalletIntegrationEnabled() && | 1363 if (IsExperimentalWalletIntegrationEnabled() && |
1359 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { | 1364 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { |
1360 profiles_.insert( | 1365 profiles_.insert( |
1361 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1366 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
1362 } | 1367 } |
1363 return profiles_; | 1368 return profiles_; |
1364 } | 1369 } |
1365 | 1370 |
1366 } // namespace autofill | 1371 } // namespace autofill |
OLD | NEW |