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

Unified Diff: chrome/browser/history/top_sites.h

Issue 2948008: Fix missing thumbnails for new profile with TopSites. (Closed)
Patch Set: After second review. Created 10 years, 5 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/thumbnail_database.cc ('k') | chrome/browser/history/top_sites.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/top_sites.h
diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h
index 44ff8c99e6b8cde570b06b4c3e3118156bc09a90..7515d2ca7eafc71fb387f5e74e14a4115b839adf 100644
--- a/chrome/browser/history/top_sites.h
+++ b/chrome/browser/history/top_sites.h
@@ -111,6 +111,7 @@ class TopSites : public NotificationObserver,
friend class TopSitesTest_Migration_Test;
friend class TopSitesTest_QueueingRequestsForTopSites_Test;
friend class TopSitesTest_CancelingRequestsForTopSites_Test;
+ friend class TopSitesTest_AddTemporaryThumbnail_Test;
~TopSites();
@@ -209,6 +210,11 @@ class TopSites : public NotificationObserver,
// Called after TopSites completes migration.
void OnMigrationDone();
+ // Add a thumbnail for an unknown url. See temp_thumbnails_map_.
+ void AddTemporaryThumbnail(const GURL& url,
+ const RefCountedBytes* thumbnail,
+ const ThumbnailScore& score);
+
Profile* profile_;
// A mockup to use for testing. If NULL, use the real HistoryService
// from the profile_. See SetMockHistoryService.
@@ -257,6 +263,12 @@ class TopSites : public NotificationObserver,
// Are we waiting for the top sites from HistoryService?
bool waiting_for_results_;
+ // Stores thumbnails for unknown pages. When SetPageThumbnail is
+ // called, if we don't know about that URL yet and we don't have
+ // enough Top Sites (new profile), we store it until the next
+ // UpdateMostVisitedURLs call.
+ std::map<GURL, Images> temp_thumbnails_map_;
+
// TODO(brettw): use the blacklist.
// std::set<GURL> blacklist_;
« no previous file with comments | « chrome/browser/history/thumbnail_database.cc ('k') | chrome/browser/history/top_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698