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_HISTORY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 6 #define CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 class HistoryServiceObserver; | 66 class HistoryServiceObserver; |
67 class HistoryTest; | 67 class HistoryTest; |
68 class InMemoryHistoryBackend; | 68 class InMemoryHistoryBackend; |
69 class InMemoryURLIndex; | 69 class InMemoryURLIndex; |
70 class InMemoryURLIndexTest; | 70 class InMemoryURLIndexTest; |
71 class URLDatabase; | 71 class URLDatabase; |
72 class VisitFilter; | 72 class VisitFilter; |
73 struct DownloadRow; | 73 struct DownloadRow; |
74 struct HistoryAddPageArgs; | 74 struct HistoryAddPageArgs; |
75 struct KeywordSearchTermVisit; | 75 struct KeywordSearchTermVisit; |
| 76 class WebHistoryService; |
76 | 77 |
77 } // namespace history | 78 } // namespace history |
78 | 79 |
79 // The history service records page titles, and visit times, as well as | 80 // The history service records page titles, and visit times, as well as |
80 // (eventually) information about autocomplete. | 81 // (eventually) information about autocomplete. |
81 // | 82 // |
82 // This service is thread safe. Each request callback is invoked in the | 83 // This service is thread safe. Each request callback is invoked in the |
83 // thread that made the request. | 84 // thread that made the request. |
84 class HistoryService : public syncer::SyncableService, | 85 class HistoryService : public syncer::SyncableService, |
85 public KeyedService, | 86 public KeyedService, |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // This is the equivalent ExpireHistoryBetween() once for each element in the | 347 // This is the equivalent ExpireHistoryBetween() once for each element in the |
347 // vector. The fields of |ExpireHistoryArgs| map directly to the arguments of | 348 // vector. The fields of |ExpireHistoryArgs| map directly to the arguments of |
348 // of ExpireHistoryBetween(). | 349 // of ExpireHistoryBetween(). |
349 void ExpireHistory(const std::vector<history::ExpireHistoryArgs>& expire_list, | 350 void ExpireHistory(const std::vector<history::ExpireHistoryArgs>& expire_list, |
350 const base::Closure& callback, | 351 const base::Closure& callback, |
351 base::CancelableTaskTracker* tracker); | 352 base::CancelableTaskTracker* tracker); |
352 | 353 |
353 // Removes all visits to the given URLs in the specified time range. Calls | 354 // Removes all visits to the given URLs in the specified time range. Calls |
354 // ExpireHistoryBetween() to delete local visits, and handles deletion of | 355 // ExpireHistoryBetween() to delete local visits, and handles deletion of |
355 // synced visits if appropriate. | 356 // synced visits if appropriate. |
356 void ExpireLocalAndRemoteHistoryBetween(const std::set<GURL>& restrict_urls, | 357 void ExpireLocalAndRemoteHistoryBetween( |
357 base::Time begin_time, | 358 history::WebHistoryService* web_history, |
358 base::Time end_time, | 359 const std::set<GURL>& restrict_urls, |
359 const base::Closure& callback, | 360 base::Time begin_time, |
360 base::CancelableTaskTracker* tracker); | 361 base::Time end_time, |
| 362 const base::Closure& callback, |
| 363 base::CancelableTaskTracker* tracker); |
361 | 364 |
362 // Processes the given |delete_directive| and sends it to the | 365 // Processes the given |delete_directive| and sends it to the |
363 // SyncChangeProcessor (if it exists). Returns any error resulting | 366 // SyncChangeProcessor (if it exists). Returns any error resulting |
364 // from sending the delete directive to sync. | 367 // from sending the delete directive to sync. |
365 syncer::SyncError ProcessLocalDeleteDirective( | 368 syncer::SyncError ProcessLocalDeleteDirective( |
366 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); | 369 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); |
367 | 370 |
368 // Downloads ----------------------------------------------------------------- | 371 // Downloads ----------------------------------------------------------------- |
369 | 372 |
370 // Implemented by the caller of 'CreateDownload' below, and is called when the | 373 // Implemented by the caller of 'CreateDownload' below, and is called when the |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 | 839 |
837 history::DeleteDirectiveHandler delete_directive_handler_; | 840 history::DeleteDirectiveHandler delete_directive_handler_; |
838 | 841 |
839 // All vended weak pointers are invalidated in Cleanup(). | 842 // All vended weak pointers are invalidated in Cleanup(). |
840 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 843 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
841 | 844 |
842 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 845 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
843 }; | 846 }; |
844 | 847 |
845 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 848 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |