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

Unified Diff: chrome/browser/thumbnails/thumbnail_service.h

Issue 11985003: Refactored-out the code of thumbnaling algorithm from thumbnail_tab_helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated a comment. Created 7 years, 11 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/thumbnails/thumbnail_service.h
diff --git a/chrome/browser/thumbnails/thumbnail_service.h b/chrome/browser/thumbnails/thumbnail_service.h
index 53da3e637e590bb942354d8071b5a711a04588ca..b1ecdd3d1d085e3c7aa371eb6749cd5e69631f64 100644
--- a/chrome/browser/thumbnails/thumbnail_service.h
+++ b/chrome/browser/thumbnails/thumbnail_service.h
@@ -16,6 +16,9 @@ class RefCountedMemory;
namespace thumbnails {
+class ThumbnailingAlgorithm;
+struct ThumbnailingContext;
+
// An interface abstracting access to thumbnails. Intended as a temporary
// bridge facilitating switch from TopSites as the thumbnail source to a more
// robust way of handling these artefacts.
@@ -24,9 +27,14 @@ class ThumbnailService : public RefcountedProfileKeyedService {
// 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.
- virtual bool SetPageThumbnail(const GURL& url,
- const gfx::Image& thumbnail,
- const ThumbnailScore& score) = 0;
+ virtual bool SetPageThumbnail(const ThumbnailingContext& context,
+ const gfx::Image& thumbnail) = 0;
+
+ // Create and return a new instance of the algorithm. They encapsulate the
sky 2013/01/22 16:10:28 This is still implying ThumbnailingAlgorithm is so
motek. 2013/01/22 16:56:19 Done.
+ // process of creating a thumbnail from tab contents. The lifetime of these
+ // instances is limited to the act of processing a single tab image. They
+ // are permitted to hold the state of such process.
+ virtual ThumbnailingAlgorithm* CreateThumbnailingAlgorithm() const = 0;
// Gets a thumbnail for a given page. Returns true iff we have the thumbnail.
// This may be invoked on any thread.

Powered by Google App Engine
This is Rietveld 408576698