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

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
« no previous file with comments | « chrome/browser/history/top_sites_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f9c2d58eadc7c5562db934915965f3ea7c41b24a 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.cc
+++ b/chrome/browser/tab_contents/thumbnail_generator.cc
@@ -671,15 +671,19 @@ 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.
ThumbnailScore current_score;
- if (is_known &&
- top_sites->GetPageThumbnailScore(url, &current_score) &&
+ if (top_sites->GetPageThumbnailScore(url, &current_score) &&
!current_score.ShouldConsiderUpdating())
return false;
+ // Skip if we don't have to udpate the temporary thumbnail (i.e. the one
+ // not yet saved).
+ ThumbnailScore temporary_score;
+ if (top_sites->GetTemporaryPageThumbnailScore(url, &temporary_score) &&
+ !temporary_score.ShouldConsiderUpdating())
+ return false;
return true;
}
« no previous file with comments | « 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