Chromium Code Reviews| 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 1320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1331 std::map<std::string, int>::iterator iter = | 1331 std::map<std::string, int>::iterator iter = |
| 1332 std::max_element(votes.begin(), votes.end(), CompareVotes); | 1332 std::max_element(votes.begin(), votes.end(), CompareVotes); |
| 1333 return iter->first; | 1333 return iter->first; |
| 1334 } | 1334 } |
| 1335 | 1335 |
| 1336 return std::string(); | 1336 return std::string(); |
| 1337 } | 1337 } |
| 1338 | 1338 |
| 1339 void PersonalDataManager::EnabledPrefChanged() { | 1339 void PersonalDataManager::EnabledPrefChanged() { |
| 1340 default_country_code_.clear(); | 1340 default_country_code_.clear(); |
| 1341 if (!pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled) && | |
| 1342 !server_credit_cards_.empty()) { | |
|
Evan Stade
2015/03/17 01:26:53
the server_credit_cards_.empty() check seems unnec
| |
| 1343 // Re-mask all server cards when the user turns off wallet card | |
| 1344 // integration. | |
| 1345 ResetFullServerCards(); | |
| 1346 } | |
| 1341 NotifyPersonalDataChanged(); | 1347 NotifyPersonalDataChanged(); |
| 1342 } | 1348 } |
| 1343 | 1349 |
| 1344 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles( | 1350 const std::vector<AutofillProfile*>& PersonalDataManager::GetProfiles( |
| 1345 bool record_metrics) const { | 1351 bool record_metrics) const { |
| 1346 #if defined(OS_MACOSX) && !defined(OS_IOS) | 1352 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 1347 bool use_auxiliary_profiles = | 1353 bool use_auxiliary_profiles = |
| 1348 pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook); | 1354 pref_service_->GetBoolean(prefs::kAutofillUseMacAddressBook); |
| 1349 #else | 1355 #else |
| 1350 bool use_auxiliary_profiles = | 1356 bool use_auxiliary_profiles = |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1362 } | 1368 } |
| 1363 if (IsExperimentalWalletIntegrationEnabled() && | 1369 if (IsExperimentalWalletIntegrationEnabled() && |
| 1364 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { | 1370 pref_service_->GetBoolean(prefs::kAutofillWalletImportEnabled)) { |
| 1365 profiles_.insert( | 1371 profiles_.insert( |
| 1366 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); | 1372 profiles_.end(), server_profiles_.begin(), server_profiles_.end()); |
| 1367 } | 1373 } |
| 1368 return profiles_; | 1374 return profiles_; |
| 1369 } | 1375 } |
| 1370 | 1376 |
| 1371 } // namespace autofill | 1377 } // namespace autofill |
| OLD | NEW |