summaryrefslogtreecommitdiffstats
path: root/chrome/browser/webdata/web_database.h
diff options
context:
space:
mode:
authorpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 20:26:28 +0000
committerpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-05 20:26:28 +0000
commit6f2ff8526c54090bf6afe9c80f2d63551231e997 (patch)
tree2cacbf423441a4f442e8ec01a176c519154c7112 /chrome/browser/webdata/web_database.h
parent2b481f8d533c08824d3aeeeb9a0407b596077c16 (diff)
downloadchromium_src-6f2ff8526c54090bf6afe9c80f2d63551231e997.zip
chromium_src-6f2ff8526c54090bf6afe9c80f2d63551231e997.tar.gz
chromium_src-6f2ff8526c54090bf6afe9c80f2d63551231e997.tar.bz2
Added functions to WebDatabase and WebDataService for recording frequent entries in text input elements in forms. Also added the class AutofillManager which gets instantiated once per WebContents and provides an API from which the database can be easily accessed to provide a list of possible desired values to be entered in a text field given what the user has already typed there.
Review URL: http://codereview.chromium.org/8845 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4809 0039d316-1c4b-4281-b951-d872f2087c98
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();