diff options
Diffstat (limited to 'chrome/browser/webdata/web_database.cc')
-rw-r--r-- | chrome/browser/webdata/web_database.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc index 3bc0438..6642529 100644 --- a/chrome/browser/webdata/web_database.cc +++ b/chrome/browser/webdata/web_database.cc @@ -985,6 +985,24 @@ bool WebDatabase::GetCountOfFormElement(int64 pair_id, int* count) { return false; } +bool WebDatabase::GetAllAutofillEntries(std::vector<AutofillEntry>* entries) { + DCHECK(entries); + sql::Statement s(db_.GetUniqueStatement("SELECT name, value FROM autofill")); + if (!s) { + NOTREACHED() << "Statement prepare failed"; + return false; + } + + while (s.Step()) { + AutofillKey key(UTF8ToUTF16(s.ColumnString(0)), + UTF8ToUTF16(s.ColumnString(1))); + AutofillEntry entry(key); + entries->push_back(entry); + } + + return s.Succeeded(); +} + bool WebDatabase::InsertFormElement(const FormField& element, int64* pair_id) { sql::Statement s(db_.GetUniqueStatement( |