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

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: Another round of updates from OWNER's review. 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..9daafa7fb0374665c39a5b047bd1691722535f78 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,15 @@ 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;
+
+ // Returns the ThumbnailingAlgorithm used for processing thumbnails.
+ // It is always a new instance, the caller owns it. It will encapsulate the
+ // 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* GetThumbnailingAlgorithm() const = 0;
// Gets a thumbnail for a given page. Returns true iff we have the thumbnail.
// This may be invoked on any thread.
« no previous file with comments | « chrome/browser/thumbnails/simple_thumbnail_crop_unittest.cc ('k') | chrome/browser/thumbnails/thumbnail_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698