summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata/web_data_service.cc
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 19:27:34 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 19:27:34 +0000
commit7ca1290d1f65a364626d737bfabed3fcd0a83dbb (patch)
tree848f8ebfab65f3696e5fed19565853c32e73c740 /chrome/browser/webdata/web_data_service.cc
parent995f4838a7642620daf0e2797b5364a7d06dc336 (diff)
downloadchromium_src-7ca1290d1f65a364626d737bfabed3fcd0a83dbb.zip
chromium_src-7ca1290d1f65a364626d737bfabed3fcd0a83dbb.tar.gz
chromium_src-7ca1290d1f65a364626d737bfabed3fcd0a83dbb.tar.bz2
Sync: Delete Autofill profiles through [Clear saved Autofill form data] does not sync
Adds notifications to batch delete of Autofill profiles and credit cards. BUG=79086 TEST=WebDataServiceAutofillTest.*:AutofillTableTest.* Review URL: http://codereview.chromium.org/6839010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81455 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_data_service.cc')
-rw-r--r--chrome/browser/webdata/web_data_service.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 122aadf..e14cc32 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -1251,10 +1251,33 @@ void WebDataService::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
GenericRequest2<Time, Time>* request) {
InitializeDatabaseIfNecessary();
if (db_ && !request->IsCancelled()) {
+ std::vector<std::string> profile_guids;
+ std::vector<std::string> credit_card_guids;
if (db_->GetAutofillTable()->
RemoveAutofillProfilesAndCreditCardsModifiedBetween(
request->GetArgument1(),
- request->GetArgument2())) {
+ request->GetArgument2(),
+ &profile_guids,
+ &credit_card_guids)) {
+ for (std::vector<std::string>::iterator iter = profile_guids.begin();
+ iter != profile_guids.end(); ++iter) {
+ AutofillProfileChange change(AutofillProfileChange::REMOVE, *iter,
+ NULL);
+ NotificationService::current()->Notify(
+ NotificationType::AUTOFILL_PROFILE_CHANGED,
+ Source<WebDataService>(this),
+ Details<AutofillProfileChange>(&change));
+ }
+
+ for (std::vector<std::string>::iterator iter = credit_card_guids.begin();
+ iter != credit_card_guids.end(); ++iter) {
+ AutofillCreditCardChange change(AutofillCreditCardChange::REMOVE,
+ *iter, NULL);
+ NotificationService::current()->Notify(
+ NotificationType::AUTOFILL_CREDIT_CARD_CHANGED,
+ Source<WebDataService>(this),
+ Details<AutofillCreditCardChange>(&change));
+ }
// Note: It is the caller's responsibility to post notifications for any
// changes, e.g. by calling the Refresh() method of PersonalDataManager.
ScheduleCommit();