summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata/web_database.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/webdata/web_database.h')
-rw-r--r--chrome/browser/webdata/web_database.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
index cff9c88..3b5c660 100644
--- a/chrome/browser/webdata/web_database.h
+++ b/chrome/browser/webdata/web_database.h
@@ -13,6 +13,7 @@
#include "chrome/browser/template_url.h"
#include "chrome/common/sqlite_utils.h"
#include "skia/include/SkBitmap.h"
+#include "webkit/glue/autofill_form.h"
namespace base {
class Time;
@@ -113,6 +114,46 @@ class WebDatabase {
//////////////////////////////////////////////////////////////////////////////
//
+ // Autofill
+ //
+ //////////////////////////////////////////////////////////////////////////////
+
+
+
+ // Records the form elements in |elements| in the database in the autofill
+ // table.
+ bool AddAutofillFormElements(
+ const std::vector<AutofillForm::Element>& elements);
+
+ // Records a single form element in in the database in the autofill table.
+ bool AddAutofillFormElement(const AutofillForm::Element& element);
+
+ // Retrieves a vector of all values which have been recorded in the autofill
+ // table as the value in a form element with name |name| and which start with
+ // |prefix|. The comparison of the prefix is case insensitive.
+ bool GetFormValuesForElementName(const std::wstring& name,
+ const std::wstring& prefix,
+ std::vector<std::wstring>* values,
+ int limit);
+
+ // Gets the pair_id and count entries from name and value specified in
+ // |element|. Sets *count to 0 if there is no such row in the table.
+ bool GetIDAndCountOfFormElement(const AutofillForm::Element& element,
+ int64* pair_id,
+ int* count);
+
+ // Updates the count entry in the row corresponding to |pair_id| to |count|.
+ bool SetCountOfFormElement(int64 pair_id, int count);
+
+ // Adds a new row to the autofill table with name and value given in
+ // |element|. Sets *pair_id to the pair_id of the new row.
+ bool InsertFormElement(const AutofillForm::Element& element, int64* pair_id);
+
+ // Adds a new row to the autofill_dates table.
+ bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created);
+
+ //////////////////////////////////////////////////////////////////////////////
+ //
// Web Apps
//
//////////////////////////////////////////////////////////////////////////////
@@ -130,6 +171,8 @@ class WebDatabase {
bool InitKeywordsTable();
bool InitLoginsTable();
+ bool InitAutofillTable();
+ bool InitAutofillDatesTable();
bool InitWebAppIconsTable();
bool InitWebAppsTable();