| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "components/visitedlink/browser/visitedlink_delegate.h" | 32 #include "components/visitedlink/browser/visitedlink_delegate.h" |
| 33 #include "sql/init_status.h" | 33 #include "sql/init_status.h" |
| 34 #include "sync/api/syncable_service.h" | 34 #include "sync/api/syncable_service.h" |
| 35 #include "ui/base/page_transition_types.h" | 35 #include "ui/base/page_transition_types.h" |
| 36 | 36 |
| 37 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
| 38 class AndroidHistoryProviderService; | 38 class AndroidHistoryProviderService; |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 class GURL; | 41 class GURL; |
| 42 class HistoryService; |
| 43 struct ImportedFaviconUsage; |
| 42 class PageUsageRequest; | 44 class PageUsageRequest; |
| 43 class Profile; | 45 class Profile; |
| 44 struct ImportedFaviconUsage; | |
| 45 class SkBitmap; | 46 class SkBitmap; |
| 46 | 47 |
| 47 namespace base { | 48 namespace base { |
| 48 class FilePath; | 49 class FilePath; |
| 49 class Thread; | 50 class Thread; |
| 50 } | 51 } |
| 51 | 52 |
| 52 namespace visitedlink { | 53 namespace visitedlink { |
| 53 class VisitedLinkMaster; | 54 class VisitedLinkMaster; |
| 54 } | 55 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 65 class HistoryQueryTest; | 66 class HistoryQueryTest; |
| 66 class HistoryServiceObserver; | 67 class HistoryServiceObserver; |
| 67 class HistoryTest; | 68 class HistoryTest; |
| 68 class InMemoryHistoryBackend; | 69 class InMemoryHistoryBackend; |
| 69 class InMemoryURLIndex; | 70 class InMemoryURLIndex; |
| 70 class InMemoryURLIndexTest; | 71 class InMemoryURLIndexTest; |
| 71 struct KeywordSearchTermVisit; | 72 struct KeywordSearchTermVisit; |
| 72 class PageUsageData; | 73 class PageUsageData; |
| 73 class URLDatabase; | 74 class URLDatabase; |
| 74 class VisitFilter; | 75 class VisitFilter; |
| 76 class WebHistoryService; |
| 75 | 77 |
| 76 } // namespace history | 78 } // namespace history |
| 77 | 79 |
| 78 // 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 |
| 79 // (eventually) information about autocomplete. | 81 // (eventually) information about autocomplete. |
| 80 // | 82 // |
| 81 // 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 |
| 82 // thread that made the request. | 84 // thread that made the request. |
| 83 class HistoryService : public syncer::SyncableService, | 85 class HistoryService : public syncer::SyncableService, |
| 84 public KeyedService, | 86 public KeyedService, |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // This is the equivalent ExpireHistoryBetween() once for each element in the | 349 // This is the equivalent ExpireHistoryBetween() once for each element in the |
| 348 // vector. The fields of |ExpireHistoryArgs| map directly to the arguments of | 350 // vector. The fields of |ExpireHistoryArgs| map directly to the arguments of |
| 349 // of ExpireHistoryBetween(). | 351 // of ExpireHistoryBetween(). |
| 350 void ExpireHistory(const std::vector<history::ExpireHistoryArgs>& expire_list, | 352 void ExpireHistory(const std::vector<history::ExpireHistoryArgs>& expire_list, |
| 351 const base::Closure& callback, | 353 const base::Closure& callback, |
| 352 base::CancelableTaskTracker* tracker); | 354 base::CancelableTaskTracker* tracker); |
| 353 | 355 |
| 354 // Removes all visits to the given URLs in the specified time range. Calls | 356 // Removes all visits to the given URLs in the specified time range. Calls |
| 355 // ExpireHistoryBetween() to delete local visits, and handles deletion of | 357 // ExpireHistoryBetween() to delete local visits, and handles deletion of |
| 356 // synced visits if appropriate. | 358 // synced visits if appropriate. |
| 357 void ExpireLocalAndRemoteHistoryBetween(const std::set<GURL>& restrict_urls, | 359 void ExpireLocalAndRemoteHistoryBetween( |
| 358 base::Time begin_time, | 360 history::WebHistoryService* web_history, |
| 359 base::Time end_time, | 361 const std::set<GURL>& restrict_urls, |
| 360 const base::Closure& callback, | 362 base::Time begin_time, |
| 361 base::CancelableTaskTracker* tracker); | 363 base::Time end_time, |
| 364 const base::Closure& callback, |
| 365 base::CancelableTaskTracker* tracker); |
| 362 | 366 |
| 363 // Processes the given |delete_directive| and sends it to the | 367 // Processes the given |delete_directive| and sends it to the |
| 364 // SyncChangeProcessor (if it exists). Returns any error resulting | 368 // SyncChangeProcessor (if it exists). Returns any error resulting |
| 365 // from sending the delete directive to sync. | 369 // from sending the delete directive to sync. |
| 366 syncer::SyncError ProcessLocalDeleteDirective( | 370 syncer::SyncError ProcessLocalDeleteDirective( |
| 367 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); | 371 const sync_pb::HistoryDeleteDirectiveSpecifics& delete_directive); |
| 368 | 372 |
| 369 // Downloads ----------------------------------------------------------------- | 373 // Downloads ----------------------------------------------------------------- |
| 370 | 374 |
| 371 // Implemented by the caller of 'CreateDownload' below, and is called when the | 375 // Implemented by the caller of 'CreateDownload' below, and is called when the |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 // A cache of the user-typed URLs kept in memory that is used by the | 813 // A cache of the user-typed URLs kept in memory that is used by the |
| 810 // autocomplete system. This will be NULL until the database has been created | 814 // autocomplete system. This will be NULL until the database has been created |
| 811 // on the background thread. | 815 // on the background thread. |
| 812 // TODO(mrossetti): Consider changing ownership. See http://crbug.com/138321 | 816 // TODO(mrossetti): Consider changing ownership. See http://crbug.com/138321 |
| 813 scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; | 817 scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; |
| 814 | 818 |
| 815 // The history client, may be null when testing. The object should otherwise | 819 // The history client, may be null when testing. The object should otherwise |
| 816 // outlive |HistoryService|. | 820 // outlive |HistoryService|. |
| 817 history::HistoryClient* history_client_; | 821 history::HistoryClient* history_client_; |
| 818 | 822 |
| 819 // The profile, may be null when testing. | |
| 820 Profile* profile_; | |
| 821 | |
| 822 // Used for propagating link highlighting data across renderers. May be null | 823 // Used for propagating link highlighting data across renderers. May be null |
| 823 // in tests. | 824 // in tests. |
| 824 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; | 825 scoped_ptr<visitedlink::VisitedLinkMaster> visitedlink_master_; |
| 825 | 826 |
| 826 // Has the backend finished loading? The backend is loaded once Init has | 827 // Has the backend finished loading? The backend is loaded once Init has |
| 827 // completed. | 828 // completed. |
| 828 bool backend_loaded_; | 829 bool backend_loaded_; |
| 829 | 830 |
| 830 // Cached values from Init(), used whenever we need to reload the backend. | 831 // Cached values from Init(), used whenever we need to reload the backend. |
| 831 base::FilePath history_dir_; | 832 base::FilePath history_dir_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 842 | 843 |
| 843 history::DeleteDirectiveHandler delete_directive_handler_; | 844 history::DeleteDirectiveHandler delete_directive_handler_; |
| 844 | 845 |
| 845 // All vended weak pointers are invalidated in Cleanup(). | 846 // All vended weak pointers are invalidated in Cleanup(). |
| 846 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 847 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
| 847 | 848 |
| 848 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 849 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
| 849 }; | 850 }; |
| 850 | 851 |
| 851 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 852 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
| OLD | NEW |