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

Unified Diff: chrome/browser/thumbnails/thumbnail_list_source.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
Index: chrome/browser/thumbnails/thumbnail_list_source.cc
diff --git a/chrome/browser/thumbnails/thumbnail_list_source.cc b/chrome/browser/thumbnails/thumbnail_list_source.cc
index bd447c20a6bd1f213e1f932223a4b7533dfbd57b..9e0bf6ea258e6a37044e352eac3b42b004e48e23 100644
--- a/chrome/browser/thumbnails/thumbnail_list_source.cc
+++ b/chrome/browser/thumbnails/thumbnail_list_source.cc
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/strings/string_util.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/search/instant_io_context.h"
#include "chrome/browser/thumbnails/thumbnail_service.h"
@@ -94,15 +95,17 @@ void ThumbnailListSource::StartDataRequest(
int render_process_id,
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
- if (!profile_->GetTopSites()) {
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
+ if (!top_sites) {
callback.Run(NULL);
return;
}
- profile_->GetTopSites()->GetMostVisitedURLs(
+ top_sites->GetMostVisitedURLs(
base::Bind(&ThumbnailListSource::OnMostVisitedURLsAvailable,
- weak_ptr_factory_.GetWeakPtr(),
- callback), true);
+ weak_ptr_factory_.GetWeakPtr(), callback),
+ true);
}
std::string ThumbnailListSource::GetMimeType(const std::string& path) const {
« no previous file with comments | « chrome/browser/search/instant_service_factory.cc ('k') | chrome/browser/thumbnails/thumbnail_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698