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 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/history/typed_url_syncable_service.h" | 27 #include "chrome/browser/history/typed_url_syncable_service.h" |
28 #include "components/favicon_base/favicon_callback.h" | 28 #include "components/favicon_base/favicon_callback.h" |
29 #include "components/favicon_base/favicon_usage_data.h" | 29 #include "components/favicon_base/favicon_usage_data.h" |
30 #include "components/history/core/browser/keyword_id.h" | 30 #include "components/history/core/browser/keyword_id.h" |
31 #include "components/keyed_service/core/keyed_service.h" | 31 #include "components/keyed_service/core/keyed_service.h" |
32 #include "sql/init_status.h" | 32 #include "sql/init_status.h" |
33 #include "sync/api/syncable_service.h" | 33 #include "sync/api/syncable_service.h" |
34 #include "ui/base/page_transition_types.h" | 34 #include "ui/base/page_transition_types.h" |
35 | 35 |
36 class GURL; | 36 class GURL; |
| 37 class InMemoryURLIndex; |
| 38 class InMemoryURLIndexTest; |
37 class PageUsageRequest; | 39 class PageUsageRequest; |
38 class SkBitmap; | 40 class SkBitmap; |
39 | 41 |
40 namespace base { | 42 namespace base { |
41 class FilePath; | 43 class FilePath; |
42 class Thread; | 44 class Thread; |
43 } | 45 } |
44 | 46 |
45 namespace history { | 47 namespace history { |
46 | 48 |
47 struct DownloadRow; | 49 struct DownloadRow; |
48 struct HistoryAddPageArgs; | 50 struct HistoryAddPageArgs; |
49 class HistoryBackend; | 51 class HistoryBackend; |
50 class HistoryClient; | 52 class HistoryClient; |
51 class HistoryDBTask; | 53 class HistoryDBTask; |
52 class HistoryDatabase; | 54 class HistoryDatabase; |
53 struct HistoryDatabaseParams; | 55 struct HistoryDatabaseParams; |
54 class HistoryQueryTest; | 56 class HistoryQueryTest; |
55 class HistoryServiceObserver; | 57 class HistoryServiceObserver; |
56 class HistoryTest; | 58 class HistoryTest; |
57 class InMemoryHistoryBackend; | 59 class InMemoryHistoryBackend; |
58 class InMemoryURLIndex; | |
59 class InMemoryURLIndexTest; | |
60 struct KeywordSearchTermVisit; | 60 struct KeywordSearchTermVisit; |
61 class PageUsageData; | 61 class PageUsageData; |
62 class URLDatabase; | 62 class URLDatabase; |
63 class VisitDelegate; | 63 class VisitDelegate; |
64 class VisitFilter; | 64 class VisitFilter; |
65 class WebHistoryService; | 65 class WebHistoryService; |
66 | 66 |
67 } // namespace history | 67 } // namespace history |
68 | 68 |
69 // The history service records page titles, and visit times, as well as | 69 // The history service records page titles, and visit times, as well as |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Reads the number of times this URL has been visited. | 128 // Reads the number of times this URL has been visited. |
129 bool GetVisitCountForURL(const GURL& url, int* visit_count); | 129 bool GetVisitCountForURL(const GURL& url, int* visit_count); |
130 | 130 |
131 // Returns a pointer to the TypedUrlSyncableService owned by HistoryBackend. | 131 // Returns a pointer to the TypedUrlSyncableService owned by HistoryBackend. |
132 // This method should only be called from the history thread, because the | 132 // This method should only be called from the history thread, because the |
133 // returned service is intended to be accessed only via the history thread. | 133 // returned service is intended to be accessed only via the history thread. |
134 history::TypedUrlSyncableService* GetTypedUrlSyncableService() const; | 134 history::TypedUrlSyncableService* GetTypedUrlSyncableService() const; |
135 | 135 |
136 // Return the quick history index. | 136 // Return the quick history index. |
137 history::InMemoryURLIndex* InMemoryIndex() const { | 137 InMemoryURLIndex* InMemoryIndex() const { return in_memory_url_index_.get(); } |
138 return in_memory_url_index_.get(); | |
139 } | |
140 | 138 |
141 // KeyedService: | 139 // KeyedService: |
142 void Shutdown() override; | 140 void Shutdown() override; |
143 | 141 |
144 // Navigation ---------------------------------------------------------------- | 142 // Navigation ---------------------------------------------------------------- |
145 | 143 |
146 // Adds the given canonical URL to history with the given time as the visit | 144 // Adds the given canonical URL to history with the given time as the visit |
147 // time. Referrer may be the empty string. | 145 // time. Referrer may be the empty string. |
148 // | 146 // |
149 // The supplied context id is used to scope the given page ID. Page IDs | 147 // The supplied context id is used to scope the given page ID. Page IDs |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 friend class base::RefCountedThreadSafe<HistoryService>; | 517 friend class base::RefCountedThreadSafe<HistoryService>; |
520 friend class BackendDelegate; | 518 friend class BackendDelegate; |
521 friend class FaviconService; | 519 friend class FaviconService; |
522 friend class history::HistoryBackend; | 520 friend class history::HistoryBackend; |
523 friend class history::HistoryQueryTest; | 521 friend class history::HistoryQueryTest; |
524 friend class HistoryOperation; | 522 friend class HistoryOperation; |
525 friend class HistoryQuickProviderTest; | 523 friend class HistoryQuickProviderTest; |
526 friend class history::HistoryTest; | 524 friend class history::HistoryTest; |
527 friend class HistoryURLProvider; | 525 friend class HistoryURLProvider; |
528 friend class HistoryURLProviderTest; | 526 friend class HistoryURLProviderTest; |
529 friend class history::InMemoryURLIndexTest; | 527 friend class ::InMemoryURLIndexTest; |
530 template<typename Info, typename Callback> friend class DownloadRequest; | 528 template<typename Info, typename Callback> friend class DownloadRequest; |
531 friend class PageUsageRequest; | 529 friend class PageUsageRequest; |
532 friend class RedirectRequest; | 530 friend class RedirectRequest; |
533 friend class SyncBookmarkDataTypeControllerTest; | 531 friend class SyncBookmarkDataTypeControllerTest; |
534 friend class TestingProfile; | 532 friend class TestingProfile; |
535 | 533 |
536 // Called on shutdown, this will tell the history backend to complete and | 534 // Called on shutdown, this will tell the history backend to complete and |
537 // will release pointers to it. No other functions should be called once | 535 // will release pointers to it. No other functions should be called once |
538 // cleanup has happened that may dispatch to the history thread (because it | 536 // cleanup has happened that may dispatch to the history thread (because it |
539 // will be null). | 537 // will be null). |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 // outlive |HistoryService|. | 801 // outlive |HistoryService|. |
804 history::HistoryClient* history_client_; | 802 history::HistoryClient* history_client_; |
805 | 803 |
806 // Has the backend finished loading? The backend is loaded once Init has | 804 // Has the backend finished loading? The backend is loaded once Init has |
807 // completed. | 805 // completed. |
808 bool backend_loaded_; | 806 bool backend_loaded_; |
809 | 807 |
810 // The index used for quick history lookups. | 808 // The index used for quick history lookups. |
811 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 809 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
812 // See http://crbug.com/138321 | 810 // See http://crbug.com/138321 |
813 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 811 scoped_ptr<InMemoryURLIndex> in_memory_url_index_; |
814 | 812 |
815 ObserverList<history::HistoryServiceObserver> observers_; | 813 ObserverList<history::HistoryServiceObserver> observers_; |
816 base::CallbackList<void(const std::set<GURL>&)> | 814 base::CallbackList<void(const std::set<GURL>&)> |
817 favicon_changed_callback_list_; | 815 favicon_changed_callback_list_; |
818 | 816 |
819 history::DeleteDirectiveHandler delete_directive_handler_; | 817 history::DeleteDirectiveHandler delete_directive_handler_; |
820 | 818 |
821 // All vended weak pointers are invalidated in Cleanup(). | 819 // All vended weak pointers are invalidated in Cleanup(). |
822 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 820 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
823 | 821 |
824 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 822 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
825 }; | 823 }; |
826 | 824 |
827 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 825 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |