diff options
Diffstat (limited to 'chromium/components/history/core/browser/top_sites.h')
-rw-r--r-- | chromium/components/history/core/browser/top_sites.h | 82 |
1 files changed, 14 insertions, 68 deletions
diff --git a/chromium/components/history/core/browser/top_sites.h b/chromium/components/history/core/browser/top_sites.h index 9937115322f..33d7c98d60c 100644 --- a/chromium/components/history/core/browser/top_sites.h +++ b/chromium/components/history/core/browser/top_sites.h @@ -12,32 +12,24 @@ #include "base/observer_list.h" #include "components/history/core/browser/history_types.h" #include "components/history/core/browser/top_sites_observer.h" -#include "components/history/core/common/thumbnail_score.h" #include "components/keyed_service/core/refcounted_keyed_service.h" #include "third_party/skia/include/core/SkColor.h" -#include "ui/gfx/image/image.h" class GURL; -namespace base { -class RefCountedMemory; -} - namespace history { -// PrepopulatedPage stores information for prepopulated page for the -// initial run. +// PrepopulatedPage stores information for prepopulated pages for the initial +// run. struct PrepopulatedPage { PrepopulatedPage(); PrepopulatedPage(const GURL& url, const base::string16& title, int favicon_id, - int thumbnail_id, SkColor color); MostVisitedURL most_visited; // The prepopulated page URL and title. int favicon_id; // The raw data resource for the favicon. - int thumbnail_id; // The raw data resource for the thumbnail. SkColor color; // The best color to highlight the page, should // roughly match the favicon. }; @@ -45,8 +37,7 @@ struct PrepopulatedPage { typedef std::vector<PrepopulatedPage> PrepopulatedPageList; // Interface for TopSites, which stores the data for the top "most visited" -// sites. This includes a cache of the most visited data from history, as well -// as the corresponding thumbnails of those sites. +// sites. This includes a cache of the most visited data from history. // // Some methods should only be called from the UI thread (see method // descriptions below). All others are assumed to be threadsafe. @@ -54,48 +45,15 @@ class TopSites : public RefcountedKeyedService { public: TopSites(); - // Sets the given thumbnail for the given URL. Returns true if the thumbnail - // was updated. False means either the URL wasn't known to us, or we felt - // that our current thumbnail was superior to the given one. Should be called - // from the UI thread. - virtual bool SetPageThumbnail(const GURL& url, - const gfx::Image& thumbnail, - const ThumbnailScore& score) = 0; - typedef base::Callback<void(const MostVisitedURLList&)> GetMostVisitedURLsCallback; - // Returns a list of most visited URLs via a callback, if - // |include_forced_urls| is false includes only non-forced URLs. This may be - // invoked on any thread. NOTE: the callback is called immediately if we have - // the data cached. If data is not available yet, callback will later be - // posted to the thread called this function. - virtual void GetMostVisitedURLs(const GetMostVisitedURLsCallback& callback, - bool include_forced_urls) = 0; - - // Gets a thumbnail for a given page. Returns true iff we have the thumbnail. - // This may be invoked on any thread. - // If an exact thumbnail URL match fails, |prefix_match| specifies whether or - // not to try harder by matching the query thumbnail URL as URL prefix (as - // defined by UrlIsPrefix()). - // As this method may be invoked on any thread the ref count needs to be - // incremented before this method returns, so this takes a scoped_refptr*. - virtual bool GetPageThumbnail( - const GURL& url, - bool prefix_match, - scoped_refptr<base::RefCountedMemory>* bytes) = 0; - - // Get a thumbnail score for a given page. Returns true iff we have the - // thumbnail score. This may be invoked on any thread. The score will - // be copied to |score|. - virtual bool GetPageThumbnailScore(const GURL& url, - ThumbnailScore* score) = 0; - - // Get a temporary thumbnail score for a given page. Returns true iff we - // have the thumbnail score. Useful when checking if we should update a - // thumbnail for a given page. The score will be copied to |score|. - virtual bool GetTemporaryPageThumbnailScore(const GURL& url, - ThumbnailScore* score) = 0; + // Returns a list of most visited URLs via a callback. This may be invoked on + // any thread. NOTE: The callback is called immediately if we have the data + // cached. If data is not available yet, callback will later be posted to the + // thread that called this function. + virtual void GetMostVisitedURLs( + const GetMostVisitedURLsCallback& callback) = 0; // Asks TopSites to refresh what it thinks the top sites are. This may do // nothing. Should be called from the UI thread. @@ -123,28 +81,16 @@ class TopSites : public RefcountedKeyedService { // This function also returns false if TopSites isn't loaded yet. virtual bool IsKnownURL(const GURL& url) = 0; - // Returns true if the top sites list of non-forced URLs is full (i.e. we - // already have the maximum number of non-forced top sites). This function - // also returns false if TopSites isn't loaded yet. - virtual bool IsNonForcedFull() = 0; - - // Returns true if the top sites list of forced URLs is full (i.e. we already - // have the maximum number of forced top sites). This function also returns - // false if TopSites isn't loaded yet. - virtual bool IsForcedFull() = 0; + // Returns true if the top sites list is full (i.e. we already have the + // maximum number of top sites). This function also returns false if TopSites + // isn't loaded yet. + virtual bool IsFull() = 0; virtual bool loaded() const = 0; - // Returns the set of prepopulate pages. + // Returns the set of prepopulated pages. virtual PrepopulatedPageList GetPrepopulatedPages() = 0; - // Adds or updates a |url| for which we should force the capture of a - // thumbnail next time it's visited. If there is already a non-forced URL - // matching this |url| this call has no effect. Indicate this URL was last - // forced at |time| so we can evict the older URLs when needed. Should be - // called from the UI thread. - virtual bool AddForcedURL(const GURL& url, const base::Time& time) = 0; - // Called when user has navigated to |url|. virtual void OnNavigationCommitted(const GURL& url) = 0; |