Skip to content

Commit

Permalink
Fix popular sites missing refreshes
Browse files Browse the repository at this point in the history
We count baked-in popular sites to personal sites when deciding
whether to refetch the current set of popular sites.
This causes popular sites to not refresh if the first fetch failed.

With this CL, we treat baked-in popular sites as popular sites which
brings back timely refreshes.

Bug: 803773
Change-Id: I96c34f02f440d453eb1ae3b422c422c4827b0127
Reviewed-on: https://chromium-review.googlesource.com/878322
Commit-Queue: Friedrich Horschig <[email protected]>
Reviewed-by: Marc Treib <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#530857}(cherry picked from commit 764f290)
Reviewed-on: https://chromium-review.googlesource.com/883441
Reviewed-by: Friedrich Horschig <[email protected]>
Cr-Commit-Position: refs/branch-heads/3325@{#58}
Cr-Branched-From: bc084a8-refs/heads/master@{#530369}
  • Loading branch information
FHorschig committed Jan 24, 2018
1 parent 83c3e58 commit 9e19030
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/ntp_tiles/most_visited_sites.cc
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,10 @@ void MostVisitedSites::SaveTilesAndNotify(NTPTilesVector personal_tiles) {

int num_personal_tiles = 0;
for (const auto& tile : *current_tiles_) {
if (tile.source != TileSource::POPULAR)
if (tile.source != TileSource::POPULAR &&
tile.source != TileSource::POPULAR_BAKED_IN) {
num_personal_tiles++;
}
}
prefs_->SetInteger(prefs::kNumPersonalTiles, num_personal_tiles);
if (!observer_)
Expand Down

0 comments on commit 9e19030

Please sign in to comment.