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

Unified Diff: chrome/browser/thumbnails/thumbnail_list_source.cc

Issue 1021803002: [Thumbnails] Injecting TopSites into ThumbnailListSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 1cba5a6b06d9a6d653fc43fbeb17181892c0993d..bbe7092963d604c2d3217c1104c34788b1139437 100644
--- a/chrome/browser/thumbnails/thumbnail_list_source.cc
+++ b/chrome/browser/thumbnails/thumbnail_list_source.cc
@@ -79,7 +79,7 @@ void RenderMostVisitedURLList(
ThumbnailListSource::ThumbnailListSource(Profile* profile)
: thumbnail_service_(ThumbnailServiceFactory::GetForProfile(profile)),
- profile_(profile),
+ top_sites_(TopSitesFactory::GetForProfile(profile)),
weak_ptr_factory_(this) {
}
@@ -95,14 +95,12 @@ void ThumbnailListSource::StartDataRequest(
int render_process_id,
int render_frame_id,
const content::URLDataSource::GotDataCallback& callback) {
- scoped_refptr<history::TopSites> top_sites =
- TopSitesFactory::GetForProfile(profile_);
- if (!top_sites) {
+ if (!top_sites_) {
callback.Run(NULL);
return;
}
- top_sites->GetMostVisitedURLs(
+ top_sites_->GetMostVisitedURLs(
base::Bind(&ThumbnailListSource::OnMostVisitedURLsAvailable,
weak_ptr_factory_.GetWeakPtr(), callback),
true);

Powered by Google App Engine
This is Rietveld 408576698