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

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

Issue 631253002: Refactor sending NOTIFICATION_HISTORY_URL_VISITED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/chrome_history_client.h
diff --git a/chrome/browser/history/chrome_history_client.h b/chrome/browser/history/chrome_history_client.h
index 92f918609c7c6004b453b46268db77f605171449..a7ddc14dec69ca494a22d90036359b85f0dcaa49 100644
--- a/chrome/browser/history/chrome_history_client.h
+++ b/chrome/browser/history/chrome_history_client.h
@@ -7,9 +7,11 @@
#include "base/macros.h"
#include "components/history/core/browser/history_client.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "components/history/core/browser/top_sites_observer.h"
class BookmarkModel;
+class HistoryService;
class Profile;
namespace history {
@@ -19,6 +21,7 @@ class TopSites;
// This class implements history::HistoryClient to abstract operations that
// depend on Chrome environment.
class ChromeHistoryClient : public history::HistoryClient,
+ public history::HistoryServiceObserver,
public history::TopSitesObserver {
public:
explicit ChromeHistoryClient(BookmarkModel* bookmark_model,
@@ -26,6 +29,8 @@ class ChromeHistoryClient : public history::HistoryClient,
history::TopSites* top_sites);
virtual ~ChromeHistoryClient();
+ void SetHistoryService(HistoryService* history_service);
+
// history::HistoryClient:
virtual void BlockUntilBookmarksLoaded() OVERRIDE;
virtual bool IsBookmarked(const GURL& url) OVERRIDE;
@@ -37,6 +42,12 @@ class ChromeHistoryClient : public history::HistoryClient,
// KeyedService:
virtual void Shutdown() OVERRIDE;
+ // HistoryServiceObserver:
+ virtual void OnURLVisited(ui::PageTransition transition,
+ const history::URLRow& row,
+ const history::RedirectList& redirects,
+ const base::Time& visit_time) OVERRIDE;
+
// TopSitesObserver:
virtual void TopSitesLoaded(history::TopSites* top_sites) OVERRIDE;
virtual void TopSitesChanged(history::TopSites* top_sites) OVERRIDE;
@@ -45,6 +56,7 @@ class ChromeHistoryClient : public history::HistoryClient,
// The BookmarkModel, this should outlive ChromeHistoryClient.
BookmarkModel* bookmark_model_;
Profile* profile_;
+ HistoryService* history_service_;
// The TopSites object is owned by the Profile (see
// chrome/browser/profiles/profile_impl.h)
// and lazily constructed by the getter.
« no previous file with comments | « no previous file | chrome/browser/history/chrome_history_client.cc » ('j') | chrome/browser/history/chrome_history_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698