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

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: 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_table.cc
diff --git a/components/autofill/browser/webdata/autofill_table.cc b/components/autofill/browser/webdata/autofill_table.cc
index a9c736738da738b33b1debf8092625e0702bbf6b..1c15d3e4c5633f3c81202acc9f2720b8673e1652 100644
--- a/components/autofill/browser/webdata/autofill_table.cc
+++ b/components/autofill/browser/webdata/autofill_table.cc
@@ -463,6 +463,17 @@ bool AutofillTable::GetFormValuesForElementName(
return s.Succeeded();
}
+bool AutofillTable::HasFormElements() {
+ sql::Statement s(db_->GetUniqueStatement(
+ "SELECT COUNT(*) FROM autofill"));
+ if (!s.Step()) {
+ NOTREACHED();
+ return false;
+ } else {
Ilya Sherman 2013/04/27 00:05:55 nit: No else stmt after a return stmt, please.
sgurun-gerrit only 2013/04/29 17:55:16 Done.
benm (inactive) 2013/04/29 18:00:03 return s.Step() ? s.ColumnInt(0) > 0 : false; loo
sgurun-gerrit only 2013/04/29 19:32:39 himm, notreached is used all over this file in sim
+ return s.ColumnInt(0) > 0;
+ }
+}
+
bool AutofillTable::RemoveFormElementsAddedBetween(
const Time& delete_begin,
const Time& delete_end,

Powered by Google App Engine
This is Rietveld 408576698