Chromium Code Reviews| 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 // Also culls timestamps to only two. TODO(georgey): remove culling in future | |
| 160 // versions. | |
| 161 bool RemoveExpiredFormElements(const base::Time& delete_end, | |
|
Ilya Sherman
2012/03/19 21:12:51
nit: I find the fact that we're passing |delete_en
GeorgeY
2012/03/20 20:47:58
sure
| |
| 162 std::vector<AutofillChange>* changes); | |
| 163 | |
| 157 // Removes from autofill_dates rows with given pair_id where date_created lies | 164 // Removes from autofill_dates rows with given pair_id where date_created lies |
| 158 // between delte_begin and delte_end. | 165 // between |delete_begin| and |delete_end|. |
| 159 bool RemoveFormElementForTimeRange(int64 pair_id, | 166 bool RemoveFormElementForTimeRange(int64 pair_id, |
| 160 const base::Time& delete_begin, | 167 const base::Time& delete_begin, |
| 161 const base::Time& delete_end, | 168 const base::Time& delete_end, |
| 162 int* how_many); | 169 int* how_many); |
| 163 | 170 |
| 164 // Increments the count in the row corresponding to |pair_id| by | 171 // Increments the count in the row corresponding to |pair_id| by |
| 165 // |delta|. Removes the row from the table and sets the | 172 // |delta|. Removes the row from the table and sets the |
| 166 // |was_removed| out parameter to true if the count becomes 0. | 173 // |was_removed| out parameter to true if the count becomes 0. |
| 167 bool AddToCountOfFormElement(int64 pair_id, int delta, bool* was_removed); | 174 bool AddToCountOfFormElement(int64 pair_id, int delta, bool* was_removed); |
| 168 | 175 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 180 bool SetCountOfFormElement(int64 pair_id, int count); | 187 bool SetCountOfFormElement(int64 pair_id, int count); |
| 181 | 188 |
| 182 // Adds a new row to the autofill table with name and value given in | 189 // 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. | 190 // |element|. Sets *pair_id to the pair_id of the new row. |
| 184 bool InsertFormElement(const webkit::forms::FormField& element, | 191 bool InsertFormElement(const webkit::forms::FormField& element, |
| 185 int64* pair_id); | 192 int64* pair_id); |
| 186 | 193 |
| 187 // Adds a new row to the autofill_dates table. | 194 // Adds a new row to the autofill_dates table. |
| 188 bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created); | 195 bool InsertPairIDAndDate(int64 pair_id, const base::Time& date_created); |
| 189 | 196 |
| 197 // Deletes last access to the Autofill data from the autofill_dates table. | |
| 198 bool DeleteLastAccess(int64 pair_id); | |
| 199 | |
| 190 // Removes row from the autofill tables given |pair_id|. | 200 // Removes row from the autofill tables given |pair_id|. |
| 191 bool RemoveFormElementForID(int64 pair_id); | 201 bool RemoveFormElementForID(int64 pair_id); |
| 192 | 202 |
| 193 // Removes row from the autofill tables for the given |name| |value| pair. | 203 // Removes row from the autofill tables for the given |name| |value| pair. |
| 194 virtual bool RemoveFormElement(const string16& name, const string16& value); | 204 virtual bool RemoveFormElement(const string16& name, const string16& value); |
| 195 | 205 |
| 196 // Retrieves all of the entries in the autofill table. | 206 // Retrieves all of the entries in the autofill table. |
| 197 virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); | 207 virtual bool GetAllAutofillEntries(std::vector<AutofillEntry>* entries); |
| 198 | 208 |
| 199 // Retrieves a single entry from the autofill table. | 209 // Retrieves a single entry from the autofill table. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 336 bool InitProfilesTable(); | 346 bool InitProfilesTable(); |
| 337 bool InitProfileNamesTable(); | 347 bool InitProfileNamesTable(); |
| 338 bool InitProfileEmailsTable(); | 348 bool InitProfileEmailsTable(); |
| 339 bool InitProfilePhonesTable(); | 349 bool InitProfilePhonesTable(); |
| 340 bool InitProfileTrashTable(); | 350 bool InitProfileTrashTable(); |
| 341 | 351 |
| 342 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 352 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 343 }; | 353 }; |
| 344 | 354 |
| 345 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 355 #endif // CHROME_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| OLD | NEW |