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

Unified Diff: components/autofill/browser/webdata/autofill_table.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: address new code review Created 7 years, 7 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_table.cc
diff --git a/components/autofill/browser/webdata/autofill_table.cc b/components/autofill/browser/webdata/autofill_table.cc
index a9c736738da738b33b1debf8092625e0702bbf6b..99eeeb48024b1f1d2cf328f9b0e3c8b1d41c9016 100644
--- a/components/autofill/browser/webdata/autofill_table.cc
+++ b/components/autofill/browser/webdata/autofill_table.cc
@@ -463,6 +463,16 @@ bool AutofillTable::GetFormValuesForElementName(
return s.Succeeded();
}
+bool AutofillTable::HasFormElements() {
+ sql::Statement s(db_->GetUniqueStatement(
+ "SELECT COUNT(*) FROM autofill"));
+ if (!s.Step()) {
+ NOTREACHED();
+ return false;
+ }
+ return s.ColumnInt(0) > 0;
+}
+
bool AutofillTable::RemoveFormElementsAddedBetween(
const Time& delete_begin,
const Time& delete_end,
« no previous file with comments | « components/autofill/browser/webdata/autofill_table.h ('k') | components/autofill/browser/webdata/autofill_table_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698