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

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

Issue 1461463002: Reland fix for thumbnail generation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits. Created 4 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_tab_helper.h
diff --git a/chrome/browser/thumbnails/thumbnail_tab_helper.h b/chrome/browser/thumbnails/thumbnail_tab_helper.h
index df9a731da1adaf3b3d8b551015a118608715b40b..5723bb2d86e6bb6315e285faed179207562ca2e9 100644
--- a/chrome/browser/thumbnails/thumbnail_tab_helper.h
+++ b/chrome/browser/thumbnails/thumbnail_tab_helper.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/thumbnails/thumbnailing_context.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -39,8 +40,26 @@ class ThumbnailTabHelper
void DidStartLoading() override;
void NavigationStopped() override;
+ // Clean up after thumbnail generation has ended.
Lei Zhang 2016/01/12 01:54:46 Might be good to put this list in chronological or
shrike 2016/01/12 19:52:39 OK.
+ void CleanUpFromThumbnailGeneration();
+
+ // Pass the thumbnail to the thumbnail service.
+ void UpdateThumbnail(
+ const thumbnails::ThumbnailingContext& context,
+ const SkBitmap& thumbnail);
+
+ // Create a thumbnail from the web contents bitmap.
+ void ProcessCapturedBitmap(
+ scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm,
+ const SkBitmap& bitmap,
+ content::ReadbackResponse response);
+
+ // Initiate asynchronous generation of a thumbnail from the web contents.
+ void AsyncProcessThumbnail(
+ scoped_refptr<thumbnails::ThumbnailService> thumbnail_service);
+
// Update the thumbnail of the given tab contents if necessary.
- void UpdateThumbnailIfNecessary(content::WebContents* web_contents);
+ void UpdateThumbnailIfNecessary();
// Called when a render view host was created for a WebContents.
void RenderViewHostCreated(content::RenderViewHost* renderer);
@@ -49,9 +68,12 @@ class ThumbnailTabHelper
void WidgetHidden(content::RenderWidgetHost* widget);
content::NotificationRegistrar registrar_;
+ scoped_refptr<thumbnails::ThumbnailingContext> thumbnailing_context_;
bool load_interrupted_;
+ base::WeakPtrFactory<ThumbnailTabHelper> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelper);
};
« no previous file with comments | « no previous file | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('j') | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698