| Index: components/ntp_tiles/most_visited_sites.cc
|
| diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc
|
| index fe51e1d5952a8c883e49b3c539178af0267e7c71..397b9e417e57e19ef82cba73c832ca1ae7f70b0d 100644
|
| --- a/components/ntp_tiles/most_visited_sites.cc
|
| +++ b/components/ntp_tiles/most_visited_sites.cc
|
| @@ -109,6 +109,10 @@ void MostVisitedSites::SetMostVisitedURLsObserver(Observer* observer,
|
| // SuggestionsService's cache or, if that is empty, sites from TopSites.
|
| BuildCurrentTiles();
|
| // Also start a request for fresh suggestions.
|
| + Refresh();
|
| +}
|
| +
|
| +void MostVisitedSites::Refresh() {
|
| suggestions_service_->FetchSuggestionsData();
|
| }
|
|
|
| @@ -131,6 +135,18 @@ void MostVisitedSites::AddOrRemoveBlacklistedUrl(const GURL& url,
|
| }
|
| }
|
|
|
| +void MostVisitedSites::ClearBlacklistedUrls() {
|
| + if (top_sites_) {
|
| + // Always update the blacklist in the local TopSites.
|
| + top_sites_->ClearBlacklistedURLs();
|
| + }
|
| +
|
| + // Only update the server-side blacklist if it's active.
|
| + if (mv_source_ == NTPTileSource::SUGGESTIONS_SERVICE) {
|
| + suggestions_service_->ClearBlacklist();
|
| + }
|
| +}
|
| +
|
| void MostVisitedSites::OnBlockedSitesChanged() {
|
| BuildCurrentTiles();
|
| }
|
| @@ -219,6 +235,8 @@ void MostVisitedSites::OnSuggestionsProfileAvailable(
|
| tile.url = url;
|
| tile.source = NTPTileSource::SUGGESTIONS_SERVICE;
|
| tile.whitelist_icon_path = GetWhitelistLargeIconPath(url);
|
| + tile.thumbnail_url = GURL(suggestion_pb.thumbnail());
|
| + tile.favicon_url = GURL(suggestion_pb.favicon_url());
|
|
|
| tiles.push_back(std::move(tile));
|
| }
|
|
|