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

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: Reupload with --no-find-copies 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
« no previous file with comments | « chrome/browser/history/chrome_history_client_factory.cc ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..eb599020e9610d3e205a949e03a053c84398e7a6 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 lifetime of |HistoryService|.
+ 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 otherwise
+ // outlive |HistoryService|.
+ history::HistoryClient* history_client_;
+
// The profile, may be null when testing.
Profile* profile_;
« no previous file with comments | « chrome/browser/history/chrome_history_client_factory.cc ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698