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

Unified Diff: components/autofill/browser/webdata/autofill_webdata_service.cc

Issue 14503010: Implement WebViewDatabase's hasFormData API for chromium based webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 7 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/browser/webdata/autofill_webdata_service.cc
diff --git a/components/autofill/browser/webdata/autofill_webdata_service.cc b/components/autofill/browser/webdata/autofill_webdata_service.cc
index 51ce68611f6c221131568ea95cf51c8a18998b7f..22dfba1e782507821d6a69816eba735260ebbdae 100644
--- a/components/autofill/browser/webdata/autofill_webdata_service.cc
+++ b/components/autofill/browser/webdata/autofill_webdata_service.cc
@@ -61,6 +61,12 @@ WebDataServiceBase::Handle AutofillWebDataService::GetFormValuesForElementName(
this, name, prefix, limit), consumer);
}
+WebDataServiceBase::Handle AutofillWebDataService::HasFormElements(
+ WebDataServiceConsumer* consumer) {
+ return wdbs_->ScheduleDBTaskWithResult(FROM_HERE,
+ Bind(&AutofillWebDataService::HasFormElementsImpl, this), consumer);
+}
+
void AutofillWebDataService::RemoveFormElementsAddedBetween(
const Time& delete_begin, const Time& delete_end) {
wdbs_->ScheduleDBTask(FROM_HERE,
@@ -212,6 +218,14 @@ AutofillWebDataService::GetFormValuesForElementNameImpl(
values));
}
+scoped_ptr<WDTypedResult> AutofillWebDataService::HasFormElementsImpl(
+ WebDatabase* db) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
+ bool value = AutofillTable::FromWebDatabase(db)->HasFormElements();
+ return scoped_ptr<WDTypedResult>(
+ new WDResult<bool>(AUTOFILL_VALUE_RESULT, value));
+}
+
WebDatabase::State AutofillWebDataService::RemoveFormElementsAddedBetweenImpl(
const base::Time& delete_begin, const base::Time& delete_end,
WebDatabase* db) {

Powered by Google App Engine
This is Rietveld 408576698