Chromium Code Reviews| Index: chrome/browser/history/history_service.h |
| diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h |
| index b2c05ca9210b418f56699e723d3a5ad1d45e5503..846d5368a21033055b29af3c4ede2a790b05cb6b 100644 |
| --- a/chrome/browser/history/history_service.h |
| +++ b/chrome/browser/history/history_service.h |
| @@ -41,6 +41,7 @@ |
| #if defined(OS_ANDROID) |
| class AndroidHistoryProviderService; |
| #endif |
| + |
| class BookmarkService; |
| class GURL; |
| class HistoryURLProvider; |
| @@ -62,6 +63,7 @@ class VisitedLinkMaster; |
| namespace history { |
| class HistoryBackend; |
| +class HistoryClient; |
| class HistoryDatabase; |
| class HistoryDBTask; |
| class HistoryQueryTest; |
| @@ -91,8 +93,9 @@ class HistoryService : public CancelableRequestProvider, |
| // Miscellaneous commonly-used types. |
| typedef std::vector<PageUsageData*> PageUsageDataList; |
| - // Must call Init after construction. |
| - explicit HistoryService(Profile* profile); |
| + // Must call Init after construction. The |history::HistoryClient| object |
| + // must be valid for the whole life time of |HistoryService|. |
|
blundell
2014/05/30 12:19:04
nit: s/life time/lifetime
|
| + explicit HistoryService(history::HistoryClient* client, Profile* profile); |
| // The empty constructor is provided only for testing. |
| HistoryService(); |
| @@ -562,6 +565,9 @@ class HistoryService : public CancelableRequestProvider, |
| // history. We filter out some URLs such as JavaScript. |
| static bool CanAddURL(const GURL& url); |
| + // Returns the HistoryClient. |
| + history::HistoryClient* history_client() { return history_client_; } |
| + |
| base::WeakPtr<HistoryService> AsWeakPtr(); |
| // syncer::SyncableService implementation. |
| @@ -1019,6 +1025,10 @@ class HistoryService : public CancelableRequestProvider, |
| // TODO(mrossetti): Consider changing ownership. See http://crbug.com/138321 |
| scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_; |
| + // The history client, may be null when testing. The object should outlive |
| + // |HistoryService|. |
| + history::HistoryClient* history_client_; |
| + |
| // The profile, may be null when testing. |
| Profile* profile_; |