OLD | NEW |
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 Loading... |
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 // Re-build the tile list. Once done, this will notify the observer. | |
424 BuildCurrentTiles(); | |
425 } | 422 } |
426 | 423 |
427 void MostVisitedSites::OnIconMadeAvailable(const GURL& site_url, | 424 void MostVisitedSites::OnIconMadeAvailable(const GURL& site_url, |
428 bool newly_available) { | 425 bool newly_available) { |
429 if (newly_available) | 426 if (newly_available) |
430 observer_->OnIconMadeAvailable(site_url); | 427 observer_->OnIconMadeAvailable(site_url); |
431 } | 428 } |
432 | 429 |
433 void MostVisitedSites::TopSitesLoaded(TopSites* top_sites) {} | 430 void MostVisitedSites::TopSitesLoaded(TopSites* top_sites) {} |
434 | 431 |
435 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, | 432 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, |
436 ChangeReason change_reason) { | 433 ChangeReason change_reason) { |
437 if (mv_source_ == NTPTileSource::TOP_SITES) { | 434 if (mv_source_ == NTPTileSource::TOP_SITES) { |
438 // The displayed tiles are invalidated. | 435 // The displayed tiles are invalidated. |
439 InitiateTopSitesQuery(); | 436 InitiateTopSitesQuery(); |
440 } | 437 } |
441 } | 438 } |
442 | 439 |
443 } // namespace ntp_tiles | 440 } // namespace ntp_tiles |
OLD | NEW |