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

Unified Diff: components/autofill/core/browser/personal_data_manager.cc

Issue 2177253003: Apply autofill profile use-date fix after sync starts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | components/autofill/core/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager.cc
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc
index 0ee989de839365f0312eea784e6c7cf6f4717a54..1a8614f8ceb7fba26a3ce64e0c8136d56e7ffdbf 100644
--- a/components/autofill/core/browser/personal_data_manager.cc
+++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -318,7 +318,12 @@ void PersonalDataManager::OnSyncServiceInitialized(
return;
}
- // Otherwise, run the de-duplication now.
+ // This runs as a one-time fix, tracked in syncable prefs. If it has already
+ // run, it is a NOP (other than checking the pref).
+ ApplyProfileUseDatesFix();
+
+ // This runs at most once per major version, tracked in syncable prefs. If it
+ // has already run for this version, it's a NOP, other than checking the pref.
ApplyDedupingRoutine();
}
@@ -349,7 +354,6 @@ void PersonalDataManager::OnWebDataServiceRequestDone(
ReceiveLoadedDbValues(h, result, &pending_profiles_query_,
&web_profiles_);
LogProfileCount(); // This only logs local profiles.
- ApplyProfileUseDatesFix();
} else {
ReceiveLoadedDbValues(h, result, &pending_server_profiles_query_,
&server_profiles_);
@@ -404,8 +408,14 @@ void PersonalDataManager::AutofillMultipleChanged() {
}
void PersonalDataManager::SyncStarted(syncer::ModelType model_type) {
- if (model_type == syncer::AUTOFILL_PROFILE &&
- is_autofill_profile_dedupe_pending_) {
+ if (model_type == syncer::AUTOFILL_PROFILE) {
+ // This runs as a one-time fix, tracked in syncable prefs. If it has already
+ // run, it is a NOP (other than checking the pref).
+ ApplyProfileUseDatesFix();
+
+ // This runs at most once per major version, tracked in syncable prefs. If
+ // it has already run for this version, it's a NOP, other than checking the
+ // pref.
ApplyDedupingRoutine();
}
}
« no previous file with comments | « no previous file | components/autofill/core/browser/personal_data_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698