| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_WEBDATA_AUTOFILL_AUTOFILL_TABLE_H_ | 5 #ifndef COMPONENTS_WEBDATA_AUTOFILL_AUTOFILL_TABLE_H_ |
| 6 #define COMPONENTS_WEBDATA_AUTOFILL_AUTOFILL_TABLE_H_ | 6 #define COMPONENTS_WEBDATA_AUTOFILL_AUTOFILL_TABLE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 // Records a single form element in the database in the autofill table. A list | 136 // Records a single form element in the database in the autofill table. A list |
| 137 // of all added and updated autofill entries is returned in the changes out | 137 // of all added and updated autofill entries is returned in the changes out |
| 138 // parameter. | 138 // parameter. |
| 139 bool AddFormFieldValue(const FormFieldData& element, | 139 bool AddFormFieldValue(const FormFieldData& element, |
| 140 std::vector<AutofillChange>* changes); | 140 std::vector<AutofillChange>* changes); |
| 141 | 141 |
| 142 // Retrieves a vector of all values which have been recorded in the autofill | 142 // Retrieves a vector of all values which have been recorded in the autofill |
| 143 // table as the value in a form element with name |name| and which start with | 143 // table as the value in a form element with name |name| and which start with |
| 144 // |prefix|. The comparison of the prefix is case insensitive. | 144 // |prefix|. The comparison of the prefix is case insensitive. |
| 145 bool GetFormValuesForElementName(const string16& name, | 145 bool GetFormValuesForElementName(const base::string16& name, |
| 146 const string16& prefix, | 146 const base::string16& prefix, |
| 147 std::vector<string16>* values, | 147 std::vector<base::string16>* values, |
| 148 int limit); | 148 int limit); |
| 149 | 149 |
| 150 // Removes rows from autofill_dates if they were created on or after | 150 // Removes rows from autofill_dates if they were created on or after |
| 151 // |delete_begin| and strictly before |delete_end|. Decrements the | 151 // |delete_begin| and strictly before |delete_end|. Decrements the |
| 152 // count of the corresponding rows in the autofill table, and | 152 // count of the corresponding rows in the autofill table, and |
| 153 // removes those rows if the count goes to 0. A list of all changed | 153 // removes those rows if the count goes to 0. A list of all changed |
| 154 // keys and whether each was updater or removed is returned in the | 154 // keys and whether each was updater or removed is returned in the |
| 155 // changes out parameter. | 155 // changes out parameter. |
| 156 bool RemoveFormElementsAddedBetween(const base::Time& delete_begin, | 156 bool RemoveFormElementsAddedBetween(const base::Time& delete_begin, |
| 157 const base::Time& delete_end, | 157 const base::Time& delete_end, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // Adds a new row to the autofill_dates table. | 199 // Adds a new row to the autofill_dates table. |
| 200 bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created); | 200 bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created); |
| 201 | 201 |
| 202 // Deletes last access to the Autofill data from the autofill_dates table. | 202 // Deletes last access to the Autofill data from the autofill_dates table. |
| 203 bool DeleteLastAccess(int64 pair_id); | 203 bool DeleteLastAccess(int64 pair_id); |
| 204 | 204 |
| 205 // Removes row from the autofill tables given |pair_id|. | 205 // Removes row from the autofill tables given |pair_id|. |
| 206 bool RemoveFormElementForID(int64 pair_id); | 206 bool RemoveFormElementForID(int64 pair_id); |
| 207 | 207 |
| 208 // Removes row from the autofill tables for the given |name| |value| pair. | 208 // Removes row from the autofill tables for the given |name| |value| pair. |
| 209 virtual bool RemoveFormElement(const string16& name, const string16& value); | 209 virtual bool RemoveFormElement(const base::string16& name, |
| 210 const base::string16& value); |
| 210 | 211 |
| 211 // Retrieves all of the entries in the autofill table. | 212 // Retrieves all of the entries in the autofill table. |
| 212 virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); | 213 virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); |
| 213 | 214 |
| 214 // Retrieves a single entry from the autofill table. | 215 // Retrieves a single entry from the autofill table. |
| 215 virtual bool GetAutofillTimestamps(const string16& name, | 216 virtual bool GetAutofillTimestamps(const base::string16& name, |
| 216 const string16& value, | 217 const base::string16& value, |
| 217 std::vector<base::Time>* timestamps); | 218 std::vector<base::Time>* timestamps); |
| 218 | 219 |
| 219 // Replaces existing autofill entries with the entries supplied in | 220 // Replaces existing autofill entries with the entries supplied in |
| 220 // the argument. If the entry does not already exist, it will be | 221 // the argument. If the entry does not already exist, it will be |
| 221 // added. | 222 // added. |
| 222 virtual bool UpdateAutofillEntries(const std::vector<AutofillEntry>& entries); | 223 virtual bool UpdateAutofillEntries(const std::vector<AutofillEntry>& entries); |
| 223 | 224 |
| 224 // Records a single Autofill profile in the autofill_profiles table. | 225 // Records a single Autofill profile in the autofill_profiles table. |
| 225 virtual bool AddAutofillProfile(const AutofillProfile& profile); | 226 virtual bool AddAutofillProfile(const AutofillProfile& profile); |
| 226 | 227 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 // The application locale. The locale is needed for the migration to version | 358 // The application locale. The locale is needed for the migration to version |
| 358 // 35. Since it must be read on the UI thread, it is set when the table is | 359 // 35. Since it must be read on the UI thread, it is set when the table is |
| 359 // created (on the UI thread), and cached here so that it can be used for | 360 // created (on the UI thread), and cached here so that it can be used for |
| 360 // migrations (on the DB thread). | 361 // migrations (on the DB thread). |
| 361 std::string app_locale_; | 362 std::string app_locale_; |
| 362 | 363 |
| 363 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 364 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 364 }; | 365 }; |
| 365 | 366 |
| 366 #endif // COMPONENTS_WEBDATA_AUTOFILL_AUTOFILL_TABLE_H_ | 367 #endif // COMPONENTS_WEBDATA_AUTOFILL_AUTOFILL_TABLE_H_ |
| OLD | NEW |