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

Unified Diff: chrome/browser/webdata/autofill_web_data_service_impl.cc

Issue 12987023: Rip autofill code out of webdataservice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: chrome/browser/webdata/autofill_web_data_service_impl.cc
diff --git a/chrome/browser/webdata/autofill_web_data_service_impl.cc b/chrome/browser/webdata/autofill_web_data_service_impl.cc
index 76dd5833620a0b5011644920a9fda50d2984930d..9bc77403b84739cf9752aeed0f6322348a03e365 100644
--- a/chrome/browser/webdata/autofill_web_data_service_impl.cc
+++ b/chrome/browser/webdata/autofill_web_data_service_impl.cc
@@ -150,6 +150,21 @@ AutofillWebDataServiceImpl::Handle AutofillWebDataServiceImpl::GetCreditCards(
Bind(&AutofillWebDataServiceImpl::GetCreditCardsImpl, this), consumer);
}
+void AutofillWebDataServiceImpl::RemoveFormElementsAddedBetween(
+ const Time& delete_begin, const Time& delete_end) {
+ wdbs_->ScheduleDBTask(FROM_HERE,
+ Bind(&AutofillWebDataServiceImpl::RemoveFormElementsAddedBetweenImpl,
+ this, delete_begin, delete_end));
+}
+
+void
+AutofillWebDataServiceImpl::RemoveAutofillProfilesAndCreditCardsModifiedBetween(
+ const Time& delete_begin, const Time& delete_end) {
+ wdbs_->ScheduleDBTask(FROM_HERE, Bind(
+&AutofillWebDataServiceImpl::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl,
dhollowa 2013/03/25 21:50:38 Gosh, this is excessive. How would you feel about
Cait (Slow) 2013/03/26 14:29:23 Done. There is a method of the same name on the Au
dhollowa 2013/03/26 15:14:09 Yes, please.
+ this, delete_begin, delete_end));
+}
+
AutofillWebDataServiceImpl::~AutofillWebDataServiceImpl() {
}
@@ -403,6 +418,34 @@ AutofillWebDataServiceImpl::GetCreditCardsImpl(WebDatabase* db) {
base::Unretained(this))));
}
+WebDatabase::State
+AutofillWebDataServiceImpl::RemoveAutofillProfilesAndCreditCardsModifiedBetweenImpl(
+ const base::Time& delete_begin, const base::Time& delete_end,
+ WebDatabase* db) {
+ std::vector<std::string> profile_guids;
+ std::vector<std::string> credit_card_guids;
+ if (AutofillTable::FromWebDatabase(db)->
+ RemoveAutofillProfilesAndCreditCardsModifiedBetween(
+ delete_begin,
+ delete_end,
+ &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);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED,
+ content::Source<AutofillWebDataService>(this),
+ content::Details<AutofillProfileChange>(&change));
+ }
+ // Note: It is the caller's responsibility to post notifications for any
+ // changes, e.g. by calling the Refresh() method of PersonalDataManager.
+ return WebDatabase::COMMIT_NEEDED;
+ }
+ return WebDatabase::COMMIT_NOT_NEEDED;
+}
+
void AutofillWebDataServiceImpl::DestroyAutofillProfileResult(
const WDTypedResult* result) {
DCHECK(result->GetType() == AUTOFILL_PROFILES_RESULT);

Powered by Google App Engine
This is Rietveld 408576698