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

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

Issue 15458003: Plugs in the new thumbnailing algorithm to ThumbnailTabHelper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed up a compile problem (indpendent change). Created 7 years, 7 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/simple_thumbnail_crop.h
diff --git a/chrome/browser/thumbnails/simple_thumbnail_crop.h b/chrome/browser/thumbnails/simple_thumbnail_crop.h
index 472eda75b3b7e3ede4e66c0f16073764b4bf45d7..0095fc1bd07b2c66be8a2f0c1b4186f8bead9bc2 100644
--- a/chrome/browser/thumbnails/simple_thumbnail_crop.h
+++ b/chrome/browser/thumbnails/simple_thumbnail_crop.h
@@ -23,7 +23,7 @@ class SimpleThumbnailCrop : public ThumbnailingAlgorithm {
gfx::Rect* clipping_rect,
gfx::Size* target_size) const OVERRIDE;
- virtual void ProcessBitmap(ThumbnailingContext* context,
+ virtual void ProcessBitmap(scoped_refptr<ThumbnailingContext> context,
const ConsumerCallback& callback,
const SkBitmap& bitmap) OVERRIDE;
@@ -46,15 +46,20 @@ class SimpleThumbnailCrop : public ThumbnailingAlgorithm {
thumbnails::ClipResult* clip_result);
static gfx::Size GetCopySizeForThumbnail(ui::ScaleFactor scale_factor,
const gfx::Size& thumbnail_size);
+ static gfx::Rect GetClippingRect(const gfx::Size& source_size,
+ const gfx::Size& desired_size,
+ ClipResult* clip_result);
+
+ // Computes the size of a thumbnail that should be stored in the database from
+ // |given_size| (expected to be the thumbnail size we would normally want to
+ // see). The returned size is expressed in pixels and is determined by
+ // bumping the resolution up to the maximum scale factor.
+ static gfx::Size ComputeTargetSizeAtMaximumScale(const gfx::Size& given_size);
protected:
virtual ~SimpleThumbnailCrop();
private:
- gfx::Size GetThumbnailSizeInPixel() const;
- static gfx::Rect GetClippingRect(const gfx::Size& source_size,
- const gfx::Size& desired_size,
- ClipResult* clip_result);
static SkBitmap CreateThumbnail(const SkBitmap& bitmap,
const gfx::Size& desired_size,
ClipResult* clip_result);

Powered by Google App Engine
This is Rietveld 408576698