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

Side by Side Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2724313003: Tiles On NTP (copy): fetch popular sites icons for 2nd NTP (Closed)
Patch Set: Rebase Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ntp_tiles/most_visited_sites.h" 5 #include "components/ntp_tiles/most_visited_sites.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 return; 412 return;
413 413
414 observer_->OnMostVisitedURLsAvailable(current_tiles_); 414 observer_->OnMostVisitedURLsAvailable(current_tiles_);
415 } 415 }
416 416
417 void MostVisitedSites::OnPopularSitesDownloaded(bool success) { 417 void MostVisitedSites::OnPopularSitesDownloaded(bool success) {
418 if (!success) { 418 if (!success) {
419 LOG(WARNING) << "Download of popular sites failed"; 419 LOG(WARNING) << "Download of popular sites failed";
420 return; 420 return;
421 } 421 }
422
423 for (const PopularSites::Site& popular_site : popular_sites_->sites()) {
424 // Ignore callback; these icons will be seen on the *next* NTP.
425 icon_cacher_->StartFetch(popular_site, base::Closure(), base::Closure());
Marc Treib 2017/03/03 09:40:44 IconCacherImpl DCHECKs that the first closure isn'
fhorschig 2017/03/03 10:27:21 Yes, there is a fix for that: https://codereview.c
426 }
422 } 427 }
423 428
424 void MostVisitedSites::OnIconMadeAvailable(const GURL& site_url) { 429 void MostVisitedSites::OnIconMadeAvailable(const GURL& site_url) {
425 observer_->OnIconMadeAvailable(site_url); 430 observer_->OnIconMadeAvailable(site_url);
426 } 431 }
427 432
428 void MostVisitedSites::TopSitesLoaded(TopSites* top_sites) {} 433 void MostVisitedSites::TopSitesLoaded(TopSites* top_sites) {}
429 434
430 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, 435 void MostVisitedSites::TopSitesChanged(TopSites* top_sites,
431 ChangeReason change_reason) { 436 ChangeReason change_reason) {
432 if (mv_source_ == NTPTileSource::TOP_SITES) { 437 if (mv_source_ == NTPTileSource::TOP_SITES) {
433 // The displayed tiles are invalidated. 438 // The displayed tiles are invalidated.
434 InitiateTopSitesQuery(); 439 InitiateTopSitesQuery();
435 } 440 }
436 } 441 }
437 442
438 } // namespace ntp_tiles 443 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698