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

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

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the Review comments Created 5 years, 11 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 fbaffc0e9cbb8ff747137dd451f753cab5dc1cac..6fb40a113c839d457997494f0e3446f3ee9968d4 100644
--- a/chrome/browser/history/chrome_history_client.h
+++ b/chrome/browser/history/chrome_history_client.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "components/history/core/browser/history_client.h"
#include "components/history/core/browser/top_sites_observer.h"
@@ -22,9 +23,10 @@ class TopSites;
class ChromeHistoryClient : public history::HistoryClient,
public history::TopSitesObserver {
public:
- explicit ChromeHistoryClient(BookmarkModel* bookmark_model,
- Profile* profile,
- history::TopSites* top_sites);
+ explicit ChromeHistoryClient(
Bernhard Bauer 2015/01/12 14:32:23 Could you remove the "explicit" here?
Jitu( very slow this week) 2015/01/12 14:55:15 Done.
+ BookmarkModel* bookmark_model,
+ Profile* profile,
+ const scoped_refptr<history::TopSites>& top_sites);
~ChromeHistoryClient() override;
// history::HistoryClient:
@@ -45,17 +47,7 @@ class ChromeHistoryClient : public history::HistoryClient,
// The BookmarkModel, this should outlive ChromeHistoryClient.
BookmarkModel* bookmark_model_;
Profile* profile_;
- // The TopSites object is owned by the Profile (see
- // chrome/browser/profiles/profile_impl.h)
- // and lazily constructed by the getter.
- // ChromeHistoryClient is a KeyedService linked to the Profile lifetime by the
- // ChromeHistoryClientFactory (which is a BrowserContextKeyedServiceFactory).
- // Before the Profile is destroyed, all the KeyedService Shutdown methods are
- // called, and the Profile is fully constructed before any of the KeyedService
- // can be constructed. The TopSites does not use the HistoryService nor the
- // HistoryClient during construction (it uses it later, but supports getting
- // an NULL pointer).
- history::TopSites* top_sites_;
+ scoped_refptr<history::TopSites> top_sites_;
DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient);
};

Powered by Google App Engine
This is Rietveld 408576698