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

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

Issue 1461463002: Reland fix for thumbnail generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/thumbnailing_context.h
diff --git a/chrome/browser/thumbnails/thumbnailing_context.h b/chrome/browser/thumbnails/thumbnailing_context.h
index 1cfe67178aeb2a2270510a0da26cb12058efddb8..fa42e7f3ea22590f1e61b7846c5cad69dcee7515 100644
--- a/chrome/browser/thumbnails/thumbnailing_context.h
+++ b/chrome/browser/thumbnails/thumbnailing_context.h
@@ -10,6 +10,7 @@
#include "chrome/browser/thumbnails/thumbnail_service.h"
#include "components/history/core/common/thumbnail_score.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/geometry/size.h"
namespace thumbnails {
@@ -34,7 +35,10 @@ enum ClipResult {
};
// Holds the information needed for processing a thumbnail.
-struct ThumbnailingContext : base::RefCountedThreadSafe<ThumbnailingContext> {
+class ThumbnailingContext
+ : public base::RefCountedThreadSafe<ThumbnailingContext>,
+ public content::WebContentsObserver {
+ public:
ThumbnailingContext(content::WebContents* web_contents,
ThumbnailService* receiving_service,
bool load_interrupted);
@@ -44,17 +48,30 @@ struct ThumbnailingContext : base::RefCountedThreadSafe<ThumbnailingContext> {
return new ThumbnailingContext();
}
- scoped_refptr<ThumbnailService> service;
- GURL url;
- ClipResult clip_result;
- gfx::Size requested_copy_size;
- ThumbnailScore score;
+ const scoped_refptr<ThumbnailService>& service() const;
+
+ const GURL& GetURL() const;
+
+ ClipResult clip_result() const;
+ void set_clip_result(ClipResult result);
+
+ gfx::Size requested_copy_size();
+ void set_requested_copy_size(const gfx::Size& requested_size);
+
+ ThumbnailScore score() const;
+ void SetBoringScore(double score);
+ void SetGoodClipping(bool is_good_clipping);
private:
ThumbnailingContext();
- ~ThumbnailingContext();
+ ~ThumbnailingContext() override;
friend class base::RefCountedThreadSafe<ThumbnailingContext>;
+
+ scoped_refptr<ThumbnailService> service_;
+ ClipResult clip_result_;
+ gfx::Size requested_copy_size_;
+ ThumbnailScore score_;
};
} // namespace thumbnails

Powered by Google App Engine
This is Rietveld 408576698