| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 5 #ifndef CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 6 #define CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 // Removes rows from autofill_dates if they were created on or after | 147 // Removes rows from autofill_dates if they were created on or after |
| 148 // |delete_begin| and strictly before |delete_end|. Decrements the | 148 // |delete_begin| and strictly before |delete_end|. Decrements the |
| 149 // count of the corresponding rows in the autofill table, and | 149 // count of the corresponding rows in the autofill table, and |
| 150 // removes those rows if the count goes to 0. A list of all changed | 150 // removes those rows if the count goes to 0. A list of all changed |
| 151 // keys and whether each was updater or removed is returned in the | 151 // keys and whether each was updater or removed is returned in the |
| 152 // changes out parameter. | 152 // changes out parameter. |
| 153 bool RemoveFormElementsAddedBetween(const base::Time& delete_begin, | 153 bool RemoveFormElementsAddedBetween(const base::Time& delete_begin, |
| 154 const base::Time& delete_end, | 154 const base::Time& delete_end, |
| 155 std::vector<AutofillChange>* changes); | 155 std::vector<AutofillChange>* changes); |
| 156 | 156 |
| 157 // Removes rows from autofill_dates if they were accessed strictly before |
| 158 // |delete_end|. Removes corresponding row from autofill table. |
| 159 bool RemoveFormElementsAccessedBefore(const base::Time& delete_end, |
| 160 std::vector<AutofillChange>* changes); |
| 161 |
| 157 // Removes from autofill_dates rows with given pair_id where date_created lies | 162 // Removes from autofill_dates rows with given pair_id where date_created lies |
| 158 // between delte_begin and delte_end. | 163 // between |delete_begin| and |delete_end|. |
| 159 bool RemoveFormElementForTimeRange(int64 pair_id, | 164 bool RemoveFormElementForTimeRange(int64 pair_id, |
| 160 const base::Time& delete_begin, | 165 const base::Time& delete_begin, |
| 161 const base::Time& delete_end, | 166 const base::Time& delete_end, |
| 162 int* how_many); | 167 int* how_many); |
| 163 | 168 |
| 164 // Increments the count in the row corresponding to |pair_id| by | 169 // Increments the count in the row corresponding to |pair_id| by |
| 165 // |delta|. Removes the row from the table and sets the | 170 // |delta|. Removes the row from the table and sets the |
| 166 // |was_removed| out parameter to true if the count becomes 0. | 171 // |was_removed| out parameter to true if the count becomes 0. |
| 167 bool AddToCountOfFormElement(int64 pair_id, int delta, bool* was_removed); | 172 bool AddToCountOfFormElement(int64 pair_id, int delta, bool* was_removed); |
| 168 | 173 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 180 bool SetCountOfFormElement(int64 pair_id, int count); | 185 bool SetCountOfFormElement(int64 pair_id, int count); |
| 181 | 186 |
| 182 // Adds a new row to the autofill table with name and value given in | 187 // Adds a new row to the autofill table with name and value given in |
| 183 // |element|. Sets *pair_id to the pair_id of the new row. | 188 // |element|. Sets *pair_id to the pair_id of the new row. |
| 184 bool InsertFormElement(const webkit::forms::FormField& element, | 189 bool InsertFormElement(const webkit::forms::FormField& element, |
| 185 int64* pair_id); | 190 int64* pair_id); |
| 186 | 191 |
| 187 // Adds a new row to the autofill_dates table. | 192 // Adds a new row to the autofill_dates table. |
| 188 bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created); | 193 bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created); |
| 189 | 194 |
| 195 // Deletes last access to the Autofill data from the autofill_dates table. |
| 196 bool DeleteLastAccess(int64 pair_id); |
| 197 |
| 190 // Removes row from the autofill tables given |pair_id|. | 198 // Removes row from the autofill tables given |pair_id|. |
| 191 bool RemoveFormElementForID(int64 pair_id); | 199 bool RemoveFormElementForID(int64 pair_id); |
| 192 | 200 |
| 193 // Removes row from the autofill tables for the given |name| |value| pair. | 201 // Removes row from the autofill tables for the given |name| |value| pair. |
| 194 virtual bool RemoveFormElement(const string16& name, const string16& value); | 202 virtual bool RemoveFormElement(const string16& name, const string16& value); |
| 195 | 203 |
| 196 // Retrieves all of the entries in the autofill table. | 204 // Retrieves all of the entries in the autofill table. |
| 197 virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); | 205 virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); |
| 198 | 206 |
| 199 // Retrieves a single entry from the autofill table. | 207 // Retrieves a single entry from the autofill table. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 bool InitProfilesTable(); | 344 bool InitProfilesTable(); |
| 337 bool InitProfileNamesTable(); | 345 bool InitProfileNamesTable(); |
| 338 bool InitProfileEmailsTable(); | 346 bool InitProfileEmailsTable(); |
| 339 bool InitProfilePhonesTable(); | 347 bool InitProfilePhonesTable(); |
| 340 bool InitProfileTrashTable(); | 348 bool InitProfileTrashTable(); |
| 341 | 349 |
| 342 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 350 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 343 }; | 351 }; |
| 344 | 352 |
| 345 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 353 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| OLD | NEW |