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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 friend class base::RefCountedThreadSafe<HistoryService>; | 513 friend class base::RefCountedThreadSafe<HistoryService>; |
516 friend class BackendDelegate; | 514 friend class BackendDelegate; |
517 friend class FaviconService; | 515 friend class FaviconService; |
518 friend class history::HistoryBackend; | 516 friend class history::HistoryBackend; |
519 friend class history::HistoryQueryTest; | 517 friend class history::HistoryQueryTest; |
520 friend class HistoryOperation; | 518 friend class HistoryOperation; |
521 friend class HistoryQuickProviderTest; | 519 friend class HistoryQuickProviderTest; |
522 friend class history::HistoryTest; | 520 friend class history::HistoryTest; |
523 friend class HistoryURLProvider; | 521 friend class HistoryURLProvider; |
524 friend class HistoryURLProviderTest; | 522 friend class HistoryURLProviderTest; |
525 friend class history::InMemoryURLIndexTest; | 523 friend class ::InMemoryURLIndexTest; |
526 template<typename Info, typename Callback> friend class DownloadRequest; | 524 template<typename Info, typename Callback> friend class DownloadRequest; |
527 friend class PageUsageRequest; | 525 friend class PageUsageRequest; |
528 friend class RedirectRequest; | 526 friend class RedirectRequest; |
529 friend class SyncBookmarkDataTypeControllerTest; | 527 friend class SyncBookmarkDataTypeControllerTest; |
530 friend class TestingProfile; | 528 friend class TestingProfile; |
531 | 529 |
532 // Called on shutdown, this will tell the history backend to complete and | 530 // Called on shutdown, this will tell the history backend to complete and |
533 // will release pointers to it. No other functions should be called once | 531 // will release pointers to it. No other functions should be called once |
534 // cleanup has happened that may dispatch to the history thread (because it | 532 // cleanup has happened that may dispatch to the history thread (because it |
535 // will be null). | 533 // will be null). |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 // outlive |HistoryService|. | 797 // outlive |HistoryService|. |
800 history::HistoryClient* history_client_; | 798 history::HistoryClient* history_client_; |
801 | 799 |
802 // Has the backend finished loading? The backend is loaded once Init has | 800 // Has the backend finished loading? The backend is loaded once Init has |
803 // completed. | 801 // completed. |
804 bool backend_loaded_; | 802 bool backend_loaded_; |
805 | 803 |
806 // The index used for quick history lookups. | 804 // The index used for quick history lookups. |
807 // TODO(mrossetti): Move in_memory_url_index out of history_service. | 805 // TODO(mrossetti): Move in_memory_url_index out of history_service. |
808 // See http://crbug.com/138321 | 806 // See http://crbug.com/138321 |
809 scoped_ptr<history::InMemoryURLIndex> in_memory_url_index_; | 807 scoped_ptr<InMemoryURLIndex> in_memory_url_index_; |
810 | 808 |
811 ObserverList<history::HistoryServiceObserver> observers_; | 809 ObserverList<history::HistoryServiceObserver> observers_; |
812 base::CallbackList<void(const std::set<GURL>&)> | 810 base::CallbackList<void(const std::set<GURL>&)> |
813 favicon_changed_callback_list_; | 811 favicon_changed_callback_list_; |
814 | 812 |
815 history::DeleteDirectiveHandler delete_directive_handler_; | 813 history::DeleteDirectiveHandler delete_directive_handler_; |
816 | 814 |
817 // All vended weak pointers are invalidated in Cleanup(). | 815 // All vended weak pointers are invalidated in Cleanup(). |
818 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; | 816 base::WeakPtrFactory<HistoryService> weak_ptr_factory_; |
819 | 817 |
820 DISALLOW_COPY_AND_ASSIGN(HistoryService); | 818 DISALLOW_COPY_AND_ASSIGN(HistoryService); |
821 }; | 819 }; |
822 | 820 |
823 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ | 821 #endif // CHROME_BROWSER_HISTORY_HISTORY_SERVICE_H_ |
OLD | NEW |