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

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: Fix tests on Android 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 bad2f0b6741c262916245aa8b9f55684e2bb90b9..1fd20a3316ba94f742afc40a1dad652a1c9b61ad 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,11 @@ class ChromeHistoryClient : public history::HistoryClient,
history::TopSites* top_sites);
virtual ~ChromeHistoryClient();
+ // TODO(sdefresne): once NOTIFICATION_HISTORY_URL* notifications are no
+ // longer used, remove this reference to the HistoryService from the
+ // ChromeHistoryClient, http://crbug.com/42178
+ void SetHistoryService(HistoryService* history_service);
+
// history::HistoryClient:
virtual void BlockUntilBookmarksLoaded() override;
virtual bool IsBookmarked(const GURL& url) override;
@@ -37,6 +45,13 @@ class ChromeHistoryClient : public history::HistoryClient,
// KeyedService:
virtual void Shutdown() override;
+ // HistoryServiceObserver:
+ virtual void OnURLVisited(HistoryService* history_service,
+ ui::PageTransition transition,
+ const history::URLRow& row,
+ const history::RedirectList& redirects,
+ base::Time visit_time) OVERRIDE;
+
// TopSitesObserver:
virtual void TopSitesLoaded(history::TopSites* top_sites) override;
virtual void TopSitesChanged(history::TopSites* top_sites) override;
@@ -45,6 +60,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 | « chrome/browser/history/android/android_provider_backend_unittest.cc ('k') | chrome/browser/history/chrome_history_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698