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

Unified Diff: components/autofill/core/browser/webdata/autofill_profile_syncable_service.h

Issue 1891903002: [Autofill] Set basic information when adding a new profiles and credit cards. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed test that was added in rebase and removed unnecessary test. Created 4 years, 8 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
Index: components/autofill/core/browser/webdata/autofill_profile_syncable_service.h
diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h
index 78c08726ea07fc1941bf29b7f50fd674b121bad5..743cf7950088bf1f87ad31a4c3177f1fe895ea9a 100644
--- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h
+++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h
@@ -121,7 +121,13 @@ class AutofillProfileSyncableService
FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest,
UpdateField);
FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest,
- MergeProfile);
+ MergeSimilarProfiles_AdditionalInfoInBothProfiles);
+ FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest,
+ MergeSimilarProfiles_DifferentUseDates);
+ FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest,
+ MergeSimilarProfiles_DifferentNames);
+ FRIEND_TEST_ALL_PREFIXES(AutofillProfileSyncableServiceTest,
+ MergeSimilarProfiles_NonZeroUseCounts);
// The map of the guid to profiles owned by the |profiles_| vector.
typedef std::map<std::string, AutofillProfile*> GUIDToProfileMap;
@@ -162,14 +168,13 @@ class AutofillProfileSyncableService
const std::string& new_value,
AutofillProfile* autofill_profile);
- // Calls merge_into->OverwriteWithOrAddTo() and then checks if the
- // |merge_into| has extra data. Returns true if |merge_from| needs updating to
- // be in sync with |merge_into|.
- // TODO(isherman): Seems like this should return |true| if |merge_into| was
- // modified at all: http://crbug.com/248440
- static bool MergeProfile(const AutofillProfile& merge_from,
- AutofillProfile* merge_into,
- const std::string& app_locale);
+ // Calls merge_into->OverwriteWith() and then checks if the
+ // |merge_into| has extra data. Returns true if the merge has made a change to
+ // |merge_into|. This should be used only for similar profiles ie. profiles
+ // where the PrimaryValue() matches.
+ static bool MergeSimilarProfiles(const AutofillProfile& merge_from,
+ AutofillProfile* merge_into,
+ const std::string& app_locale);
AutofillWebDataBackend* webdata_backend_; // WEAK
std::string app_locale_;

Powered by Google App Engine
This is Rietveld 408576698