Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: chrome/browser/history/history_service.h

Issue 305443004: Introduce HistoryClient interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@371825
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..a9753401bb966ad3fe1faeed1e4d29cb600cbd64 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;
@@ -85,14 +87,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.
blundell 2014/05/27 09:56:38 add a comment about expected lifetime.
sdefresne 2014/05/28 17:10:42 Done.
- explicit HistoryService(Profile* profile);
+ explicit HistoryService(history::HistoryClient* client, Profile* profile);
// The empty constructor is provided only for testing.
HistoryService();
@@ -164,8 +165,7 @@ class HistoryService : public CancelableRequestProvider,
return in_memory_url_index_.get();
}
- // KeyedService:
- virtual void Shutdown() OVERRIDE;
+ void Shutdown();
// Navigation ----------------------------------------------------------------
@@ -562,6 +562,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_; }
blundell 2014/05/27 09:56:38 same comment about const.
sdefresne 2014/05/28 17:10:42 Done.
+
base::WeakPtr<HistoryService> AsWeakPtr();
// syncer::SyncableService implementation.
@@ -1019,6 +1022,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.
blundell 2014/05/27 09:56:38 add a comment about expected lifetime.
sdefresne 2014/05/28 17:10:42 Done.
+ history::HistoryClient* history_client_;
+
// The profile, may be null when testing.
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698