| 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));
|
| }
|
|
|