Chromium Code Reviews| Index: chrome/common/thumbnail_score.h |
| diff --git a/chrome/common/thumbnail_score.h b/chrome/common/thumbnail_score.h |
| index 30bcf8fb6049b538e7cdd02a3fbb72038a93e94a..ee32cad415d73c30d1505cb995172f0d10b97319 100644 |
| --- a/chrome/common/thumbnail_score.h |
| +++ b/chrome/common/thumbnail_score.h |
| @@ -6,6 +6,7 @@ |
| #define CHROME_COMMON_THUMBNAIL_SCORE_H_ |
| #pragma once |
| +#include <string> |
| #include "base/time.h" |
| // A set of metadata about a Thumbnail. |
| @@ -27,6 +28,9 @@ struct ThumbnailScore { |
| // Tests for equivalence between two ThumbnailScore objects. |
| bool Equals(const ThumbnailScore& rhs) const; |
| + // Returns string representation of this object. |
| + std::string ToString() const; |
| + |
| // How "boring" a thumbnail is. The boring score is the 0,1 ranged |
| // percentage of pixels that are the most common luma. Higher boring |
| // scores indicate that a higher percentage of a bitmap are all the |
| @@ -67,6 +71,10 @@ struct ThumbnailScore { |
| // How bad a thumbnail needs to be before we completely ignore it. |
| static const double kThumbnailMaximumBoringness; |
| + // We consider a thumbnail interesting enough if the boring score is |
| + // lower than this. |
| + static const double kThumbnailInterestingEnoughBoringness; |
| + |
| // Time before we take a worse thumbnail (subject to |
| // kThumbnailMaximumBoringness) over what's currently in the database |
| // for freshness. |
| @@ -80,4 +88,9 @@ struct ThumbnailScore { |
| bool ShouldReplaceThumbnailWith(const ThumbnailScore& current, |
| const ThumbnailScore& replacement); |
| +// Checks whether we should generate a new thumbnail. For instance, we |
| +// don't have to generaet a new thumbnail if the current thumbnail is new |
| +// and interesting enough. |
| +bool ShouldGenerateThumbnail(const ThumbnailScore& current); |
|
brettw
2011/01/26 05:55:20
Can you move this to the ThumbnailScore class? The
satorux1
2011/01/26 08:14:46
Agreed. Changed accordingly. Chose ShouldConsiderU
|
| + |
| #endif // CHROME_COMMON_THUMBNAIL_SCORE_H_ |