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

Unified Diff: chrome/browser/tab_contents/thumbnail_generator.cc

Issue 6813040: Add TopSites::GetTemporaryThumbnailScore(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 years, 8 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: chrome/browser/tab_contents/thumbnail_generator.cc
diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc
index 6acae584d0b1ad475803379470fa797730581c04..ac02e1f59d01236db5bd012cace4033ebb884fb5 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator.cc
@@ -671,13 +671,13 @@ bool ThumbnailGenerator::ShouldUpdateThumbnail(Profile* profile,
if (!HistoryService::CanAddURL(url))
return false;
// Skip if the top sites list is full, and the URL is not known.
- const bool is_known = top_sites->IsKnownURL(url);
- if (top_sites->IsFull() && !is_known)
+ if (top_sites->IsFull() && !top_sites->IsKnownURL(url))
return false;
- // Skip if we don't have to udpate the existing thumbnail.
+ // Skip if we don't have to udpate the existing thumbnail. Note that an
+ // unknown URL can have a thumbnail score. This can happen if a
+ // thumbnail is set but not yet saved.
ThumbnailScore current_score;
- if (is_known &&
- top_sites->GetPageThumbnailScore(url, &current_score) &&
+ if (top_sites->GetPageThumbnailScore(url, &current_score) &&
!current_score.ShouldConsiderUpdating())
return false;
« chrome/browser/history/top_sites.cc ('K') | « chrome/browser/history/top_sites_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698