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

Unified Diff: components/ntp_tiles/most_visited_sites.h

Issue 2388783004: Ensure PopularSite icon availability in ntp_tiles. (Closed)
Patch Set: Fix comments, variable names. Created 4 years, 2 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: components/ntp_tiles/most_visited_sites.h
diff --git a/components/ntp_tiles/most_visited_sites.h b/components/ntp_tiles/most_visited_sites.h
index 28f9b070df0a6421fec0400df63b023a84af57ec..aad5edac2e25ba3e6235ddaec5d918250b9b7558 100644
--- a/components/ntp_tiles/most_visited_sites.h
+++ b/components/ntp_tiles/most_visited_sites.h
@@ -34,6 +34,8 @@ class PrefRegistrySyncable;
namespace ntp_tiles {
+class IconCacher;
+
// Shim interface for SupervisedUserService.
class MostVisitedSitesSupervisor {
public:
@@ -105,7 +107,8 @@ class MostVisitedSites : public history::TopSitesObserver,
class Observer {
public:
virtual void OnMostVisitedURLsAvailable(const NTPTilesVector& tiles) = 0;
- virtual void OnPopularURLsAvailable(const PopularSitesVector& sites) {}
+ // TODO(sfiera): make this method required after iOS implements it:
+ virtual void OnIconMadeAvailable(const GURL& site_url) {}
protected:
virtual ~Observer() {}
@@ -120,6 +123,7 @@ class MostVisitedSites : public history::TopSitesObserver,
scoped_refptr<history::TopSites> top_sites,
suggestions::SuggestionsService* suggestions,
std::unique_ptr<PopularSites> popular_sites,
+ std::unique_ptr<IconCacher> icon_cacher,
MostVisitedSitesSupervisor* supervisor);
~MostVisitedSites() override;
@@ -143,6 +147,8 @@ class MostVisitedSites : public history::TopSitesObserver,
private:
friend class MostVisitedSitesTest;
+ void OnIconMadeAvailable(const GURL& site_url, bool newly_available);
Marc Treib 2016/10/12 09:11:29 nit: Maybe move this below OnPopularSitesAvailable
sfiera 2016/10/13 09:06:46 Done.
+
void BuildCurrentTiles();
// Initialize the query to Top Sites. Called if the SuggestionsService
@@ -198,6 +204,7 @@ class MostVisitedSites : public history::TopSitesObserver,
scoped_refptr<history::TopSites> top_sites_;
suggestions::SuggestionsService* suggestions_service_;
std::unique_ptr<PopularSites> const popular_sites_;
+ std::unique_ptr<IconCacher> const icon_cacher_;
MostVisitedSitesSupervisor* supervisor_;
Observer* observer_;

Powered by Google App Engine
This is Rietveld 408576698