Index: components/ntp_tiles/popular_sites_impl.cc |
diff --git a/components/ntp_tiles/popular_sites_impl.cc b/components/ntp_tiles/popular_sites_impl.cc |
index 566202b07d88c8cc228312ce4c98dbf0a5776b03..842133a850fd3bb640b971228f1c2f4f4d7ed45d 100644 |
--- a/components/ntp_tiles/popular_sites_impl.cc |
+++ b/components/ntp_tiles/popular_sites_impl.cc |
@@ -21,6 +21,7 @@ |
#include "components/google/core/browser/google_util.h" |
#include "components/ntp_tiles/constants.h" |
#include "components/ntp_tiles/field_trial.h" |
+#include "components/ntp_tiles/icon_cacher.h" |
#include "components/ntp_tiles/pref_names.h" |
#include "components/ntp_tiles/switches.h" |
#include "components/pref_registry/pref_registry_syncable.h" |
@@ -305,6 +306,23 @@ void PopularSitesImpl::RegisterProfilePrefs( |
DefaultPopularSites().release()); |
} |
+// static |
+void PopularSitesImpl::AddIconsForDefaultPagesToCacher(const PrefService& prefs, |
+ IconCacher* cacher) { |
+#if defined(OS_ANDROID) || defined(OS_IOS) |
+ PopularSites::SitesVector sites = |
+ ParseSiteList(*prefs.GetList(kPopularSitesJsonPref)); |
+ cacher->AddDefaultImage(sites[0], IDR_DEFAULT_POPULAR_SITES_ICON0); |
+ cacher->AddDefaultImage(sites[1], IDR_DEFAULT_POPULAR_SITES_ICON1); |
+ cacher->AddDefaultImage(sites[2], IDR_DEFAULT_POPULAR_SITES_ICON2); |
+ cacher->AddDefaultImage(sites[3], IDR_DEFAULT_POPULAR_SITES_ICON3); |
+ cacher->AddDefaultImage(sites[4], IDR_DEFAULT_POPULAR_SITES_ICON4); |
+ cacher->AddDefaultImage(sites[5], IDR_DEFAULT_POPULAR_SITES_ICON5); |
+ cacher->AddDefaultImage(sites[6], IDR_DEFAULT_POPULAR_SITES_ICON6); |
+ cacher->AddDefaultImage(sites[7], IDR_DEFAULT_POPULAR_SITES_ICON7); |
+#endif |
+} |
+ |
void PopularSitesImpl::FetchPopularSites() { |
fetcher_ = URLFetcher::Create(pending_url_, URLFetcher::GET, this); |
data_use_measurement::DataUseUserData::AttachToFetcher( |