| 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 CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ |
| 6 #define CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ | 6 #define CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // visits will have to be deleted in another pass. | 188 // visits will have to be deleted in another pass. |
| 189 // | 189 // |
| 190 // The affected URLs will be filled into the given dependencies structure. | 190 // The affected URLs will be filled into the given dependencies structure. |
| 191 void ArchiveURLsAndVisits(const VisitVector& visits, | 191 void ArchiveURLsAndVisits(const VisitVector& visits, |
| 192 DeleteDependencies* dependencies); | 192 DeleteDependencies* dependencies); |
| 193 | 193 |
| 194 // Deletes the favicons listed in the set if unused. Fails silently (we don't | 194 // Deletes the favicons listed in the set if unused. Fails silently (we don't |
| 195 // care about favicons so much, so don't want to stop everything if it fails). | 195 // care about favicons so much, so don't want to stop everything if it fails). |
| 196 void DeleteFaviconsIfPossible(const std::set<FaviconID>& favicon_id); | 196 void DeleteFaviconsIfPossible(const std::set<FaviconID>& favicon_id); |
| 197 | 197 |
| 198 // Enum representing what type of action resulted in the history DB deletion. |
| 199 enum DeletionType { |
| 200 // User initiated the deletion from the History UI. |
| 201 DELETION_USER_INITIATED, |
| 202 // History data was automatically archived due to being more than 90 days |
| 203 // old. |
| 204 DELETION_ARCHIVED |
| 205 }; |
| 206 |
| 198 // Broadcast the URL deleted notification. | 207 // Broadcast the URL deleted notification. |
| 199 void BroadcastDeleteNotifications(DeleteDependencies* dependencies); | 208 void BroadcastDeleteNotifications(DeleteDependencies* dependencies, |
| 209 DeletionType type); |
| 200 | 210 |
| 201 // Schedules a call to DoArchiveIteration. | 211 // Schedules a call to DoArchiveIteration. |
| 202 void ScheduleArchive(); | 212 void ScheduleArchive(); |
| 203 | 213 |
| 204 // Calls ArchiveSomeOldHistory to expire some amount of old history, according | 214 // Calls ArchiveSomeOldHistory to expire some amount of old history, according |
| 205 // to the items in work queue, and schedules another call to happen in the | 215 // to the items in work queue, and schedules another call to happen in the |
| 206 // future. | 216 // future. |
| 207 void DoArchiveIteration(); | 217 void DoArchiveIteration(); |
| 208 | 218 |
| 209 // Tries to expire the oldest |max_visits| visits from history that are older | 219 // Tries to expire the oldest |max_visits| visits from history that are older |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 // Use GetBookmarkService to access this, which makes sure the service is | 287 // Use GetBookmarkService to access this, which makes sure the service is |
| 278 // loaded. | 288 // loaded. |
| 279 BookmarkService* bookmark_service_; | 289 BookmarkService* bookmark_service_; |
| 280 | 290 |
| 281 DISALLOW_COPY_AND_ASSIGN(ExpireHistoryBackend); | 291 DISALLOW_COPY_AND_ASSIGN(ExpireHistoryBackend); |
| 282 }; | 292 }; |
| 283 | 293 |
| 284 } // namespace history | 294 } // namespace history |
| 285 | 295 |
| 286 #endif // CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ | 296 #endif // CHROME_BROWSER_HISTORY_EXPIRE_HISTORY_BACKEND_H_ |
| OLD | NEW |