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

Unified Diff: chrome/browser/autofill/personal_data_manager.cc

Issue 2884051: Merge 53276 - AutoFill Empty profiles should not be saved from AutoFillDialog... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autofill/credit_card.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/personal_data_manager.cc
===================================================================
--- chrome/browser/autofill/personal_data_manager.cc (revision 54215)
+++ chrome/browser/autofill/personal_data_manager.cc (working copy)
@@ -27,18 +27,6 @@
const char kUnlabeled[] = "Unlabeled";
-bool IsEmptyProfile(const AutoFillProfile& profile) {
- FieldTypeSet types;
- profile.GetAvailableFieldTypes(&types);
- return types.empty();
-}
-
-bool IsEmptyCreditCard(const CreditCard& credit_card) {
- FieldTypeSet types;
- credit_card.GetAvailableFieldTypes(&types);
- return types.empty() && credit_card.billing_address().empty();
-}
-
} // namespace
PersonalDataManager::~PersonalDataManager() {
@@ -231,7 +219,8 @@
// Remove empty profiles from input.
profiles->erase(
- std::remove_if(profiles->begin(), profiles->end(), IsEmptyProfile),
+ std::remove_if(profiles->begin(), profiles->end(),
+ std::mem_fun_ref(&AutoFillProfile::IsEmpty)),
profiles->end());
SetUniqueProfileLabels(profiles);
@@ -310,7 +299,8 @@
// Remove empty credit cards from input.
credit_cards->erase(
std::remove_if(
- credit_cards->begin(), credit_cards->end(), IsEmptyCreditCard),
+ credit_cards->begin(), credit_cards->end(),
+ std::mem_fun_ref(&CreditCard::IsEmpty)),
credit_cards->end());
SetUniqueCreditCardLabels(credit_cards);
« no previous file with comments | « chrome/browser/autofill/credit_card.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698