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

Unified Diff: chrome/browser/history/chrome_history_client_factory.cc

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix 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_factory.cc
diff --git a/chrome/browser/history/chrome_history_client_factory.cc b/chrome/browser/history/chrome_history_client_factory.cc
index 10c8618e91d43199f6dfdbdad3bdc4c4afafadbb..0178506c1e69591f479cf0cfe0a501a3574fc729 100644
--- a/chrome/browser/history/chrome_history_client_factory.cc
+++ b/chrome/browser/history/chrome_history_client_factory.cc
@@ -7,6 +7,7 @@
#include "base/memory/singleton.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/history/chrome_history_client.h"
+#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
@@ -35,6 +36,7 @@ ChromeHistoryClientFactory::ChromeHistoryClientFactory()
"ChromeHistoryClient",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(BookmarkModelFactory::GetInstance());
+ DependsOn(TopSitesFactory::GetInstance());
}
ChromeHistoryClientFactory::~ChromeHistoryClientFactory() {
@@ -43,9 +45,10 @@ ChromeHistoryClientFactory::~ChromeHistoryClientFactory() {
KeyedService* ChromeHistoryClientFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
Profile* profile = static_cast<Profile*>(context);
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile);
return new ChromeHistoryClient(BookmarkModelFactory::GetForProfile(profile),
- profile,
- profile->GetTopSites());
+ profile, top_sites.get());
Bernhard Bauer 2015/01/08 10:22:05 Remove the .get() when ChromeHistoryClient can tak
Jitu( very slow this week) 2015/01/12 11:30:07 Done.
}
content::BrowserContext* ChromeHistoryClientFactory::GetBrowserContextToUse(

Powered by Google App Engine
This is Rietveld 408576698