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

Unified Diff: chrome/browser/ui/webui/ntp/suggestions_page_handler.cc

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra inclusion from testing_profile.h 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
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
index 2689c20e21f22b1e44fe47594ab1afa111b51ebc..5bfdb2da54a6c62bfdce3b00c119926f033fd12a 100644
--- a/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
+++ b/chrome/browser/ui/webui/ntp/suggestions_page_handler.cc
@@ -16,6 +16,7 @@
#include "base/threading/thread.h"
#include "base/values.h"
#include "chrome/browser/history/top_sites.h"
+#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/ntp/ntp_stats.h"
@@ -68,7 +69,8 @@ void SuggestionsHandler::RegisterMessages() {
// TODO(georgey) change the source of the web-sites to provide our data.
// Initial commit uses top sites as a data source.
- history::TopSites* top_sites = profile->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile);
if (top_sites) {
// TopSites updates itself after a delay. This is especially noticable when
// your profile is empty. Ask TopSites to update itself when we're about to
@@ -77,7 +79,7 @@ void SuggestionsHandler::RegisterMessages() {
// Register as TopSitesObserver so that we can update ourselves when the
// TopSites changes.
- scoped_observer_.Add(top_sites);
+ scoped_observer_.Add(top_sites.get());
}
// Setup the suggestions sources.
« no previous file with comments | « chrome/browser/ui/webui/ntp/most_visited_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698