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

Unified Diff: chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc

Issue 2695713004: Add baked-in favicons for default popular sites on NTP (Closed)
Patch Set: Have python script adhere to guidelines Created 3 years, 10 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 | « no previous file | components/ntp_tiles/DEPS » ('j') | components/ntp_tiles/icon_cacher_impl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc
diff --git a/chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc b/chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc
index ffa827262cbb9da21404ea8e88370f5fe37d9bec..caf47b4dbec1a3a1e46ba0a1d864799c85c3cc8a 100644
--- a/chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc
+++ b/chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.cc
@@ -26,6 +26,7 @@
#include "components/ntp_tiles/icon_cacher_impl.h"
#include "components/ntp_tiles/metrics.h"
#include "components/ntp_tiles/most_visited_sites.h"
+#include "components/ntp_tiles/popular_sites_impl.h"
using suggestions::SuggestionsServiceFactory;
@@ -113,19 +114,24 @@ ChromeMostVisitedSitesFactory::NewForProfile(Profile* profile) {
return nullptr;
}
- return base::MakeUnique<ntp_tiles::MostVisitedSites>(
- profile->GetPrefs(), TopSitesFactory::GetForProfile(profile),
- SuggestionsServiceFactory::GetForProfile(profile),
-#if defined(OS_ANDROID)
- ChromePopularSitesFactory::NewForProfile(profile),
-#else
- nullptr,
-#endif
+ std::unique_ptr<ntp_tiles::IconCacher> icon_cacher =
base::MakeUnique<ntp_tiles::IconCacherImpl>(
FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::IMPLICIT_ACCESS),
base::MakeUnique<image_fetcher::ImageFetcherImpl>(
base::MakeUnique<suggestions::ImageDecoderImpl>(),
- profile->GetRequestContext())),
+ profile->GetRequestContext()));
+
+ std::unique_ptr<ntp_tiles::PopularSites> popular_sites = nullptr;
+#if defined(OS_ANDROID)
+ popular_sites = ChromePopularSitesFactory::NewForProfile(profile);
+ ntp_tiles::PopularSitesImpl::AddIconsForDefaultPagesToCacher(
+ *profile->GetPrefs(), icon_cacher.get());
+#endif
+
+ return base::MakeUnique<ntp_tiles::MostVisitedSites>(
+ profile->GetPrefs(), TopSitesFactory::GetForProfile(profile),
+ SuggestionsServiceFactory::GetForProfile(profile),
+ std::move(popular_sites), std::move(icon_cacher),
base::MakeUnique<SupervisorBridge>(profile));
}
« no previous file with comments | « no previous file | components/ntp_tiles/DEPS » ('j') | components/ntp_tiles/icon_cacher_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698