| Index: chrome/browser/history/history_service.h
|
| diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h
|
| index 1c6bc0eb152b3efe788054d9f05bc475c295405d..c4c59d6c7e5e39e90710b0cb6a1d82e9a5af416c 100644
|
| --- a/chrome/browser/history/history_service.h
|
| +++ b/chrome/browser/history/history_service.h
|
| @@ -28,6 +28,7 @@
|
| #include "chrome/browser/search_engines/template_url_id.h"
|
| #include "chrome/common/ref_counted_util.h"
|
| #include "components/favicon_base/favicon_callback.h"
|
| +#include "components/history/core/browser/history_client.h"
|
| #include "components/keyed_service/core/keyed_service.h"
|
| #include "components/visitedlink/browser/visitedlink_delegate.h"
|
| #include "content/public/browser/download_manager_delegate.h"
|
| @@ -42,7 +43,6 @@
|
| #include "chrome/browser/history/android/android_history_provider_service.h"
|
| #endif
|
|
|
| -class BookmarkService;
|
| class GURL;
|
| class HistoryURLProvider;
|
| class PageUsageData;
|
| @@ -86,14 +86,13 @@ struct HistoryDetails;
|
| class HistoryService : public CancelableRequestProvider,
|
| public content::NotificationObserver,
|
| public syncer::SyncableService,
|
| - public KeyedService,
|
| public visitedlink::VisitedLinkDelegate {
|
| public:
|
| // Miscellaneous commonly-used types.
|
| typedef std::vector<PageUsageData*> PageUsageDataList;
|
|
|
| // Must call Init after construction.
|
| - explicit HistoryService(Profile* profile);
|
| + explicit HistoryService(history::HistoryClient* client, Profile* profile);
|
| // The empty constructor is provided only for testing.
|
| HistoryService();
|
|
|
| @@ -101,10 +100,9 @@ class HistoryService : public CancelableRequestProvider,
|
|
|
| // Initializes the history service, returning true on success. On false, do
|
| // not call any other functions. The given directory will be used for storing
|
| - // the history files. The BookmarkService is used when deleting URLs to
|
| - // test if a URL is bookmarked; it may be NULL during testing.
|
| - bool Init(const base::FilePath& history_dir, BookmarkService* bookmark_service) {
|
| - return Init(history_dir, bookmark_service, false);
|
| + // the history files.
|
| + bool Init(const base::FilePath& history_dir) {
|
| + return Init(history_dir, false);
|
| }
|
|
|
| // Triggers the backend to load if it hasn't already, and then returns whether
|
| @@ -165,9 +163,6 @@ class HistoryService : public CancelableRequestProvider,
|
| return in_memory_url_index_.get();
|
| }
|
|
|
| - // KeyedService:
|
| - virtual void Shutdown() OVERRIDE;
|
| -
|
| // Navigation ----------------------------------------------------------------
|
|
|
| // Adds the given canonical URL to history with the given time as the visit
|
| @@ -563,6 +558,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() const { return history_client_; }
|
| +
|
| base::WeakPtr<HistoryService> AsWeakPtr();
|
|
|
| // syncer::SyncableService implementation.
|
| @@ -618,9 +616,7 @@ class HistoryService : public CancelableRequestProvider,
|
|
|
| // Low-level Init(). Same as the public version, but adds a |no_db| parameter
|
| // that is only set by unittests which causes the backend to not init its DB.
|
| - bool Init(const base::FilePath& history_dir,
|
| - BookmarkService* bookmark_service,
|
| - bool no_db);
|
| + bool Init(const base::FilePath& history_dir, bool no_db);
|
|
|
| // Called by the HistoryURLProvider class to schedule an autocomplete, it
|
| // will be called back on the internal history thread with the history
|
| @@ -1020,6 +1016,9 @@ class HistoryService : public CancelableRequestProvider,
|
| // TODO(mrossetti): Consider changing ownership. See http://crbug.com/138321
|
| scoped_ptr<history::InMemoryHistoryBackend> in_memory_backend_;
|
|
|
| + // The HistoryClient; may be NULL in tests.
|
| + history::HistoryClient* history_client_;
|
| +
|
| // The profile, may be null when testing.
|
| Profile* profile_;
|
|
|
| @@ -1033,7 +1032,6 @@ class HistoryService : public CancelableRequestProvider,
|
|
|
| // Cached values from Init(), used whenever we need to reload the backend.
|
| base::FilePath history_dir_;
|
| - BookmarkService* bookmark_service_;
|
| bool no_db_;
|
|
|
| // The index used for quick history lookups.
|
|
|