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

Unified Diff: chrome/browser/tab_contents/thumbnail_generator.h

Issue 6010004: Refactor RenderWidgetHost::set_paint_observer() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove helper classes per review Created 9 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/tab_contents/thumbnail_generator.h
diff --git a/chrome/browser/tab_contents/thumbnail_generator.h b/chrome/browser/tab_contents/thumbnail_generator.h
index 51fc1ffa4eb04038a4128bdd9c402c34729c1d65..335b2cbcd8e4ea75f1aaa4ea4e32b3bd488f3635 100644
--- a/chrome/browser/tab_contents/thumbnail_generator.h
+++ b/chrome/browser/tab_contents/thumbnail_generator.h
@@ -15,7 +15,7 @@
#include "base/linked_ptr.h"
#include "base/lock.h"
#include "base/timer.h"
-#include "chrome/browser/renderer_host/render_widget_host_painting_observer.h"
+#include "chrome/browser/renderer_host/backing_store.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
@@ -23,10 +23,7 @@ class RenderWidgetHost;
class SkBitmap;
class TabContents;
-// This class MUST be destroyed after the RenderWidgetHosts, since it installs
-// a painting observer that is not removed.
-class ThumbnailGenerator : public RenderWidgetHostPaintingObserver,
- public NotificationObserver {
+class ThumbnailGenerator : NotificationObserver {
public:
typedef Callback1<const SkBitmap&>::Type ThumbnailReadyCallback;
// This class will do nothing until you call StartThumbnailing.
@@ -64,6 +61,10 @@ class ThumbnailGenerator : public RenderWidgetHostPaintingObserver,
// renderer.
SkBitmap GetThumbnailForRenderer(RenderWidgetHost* renderer) const;
+ // Start or stop monitoring notifications for |renderer| based on the value
+ // of |monitor|.
+ void MonitorRenderer(RenderWidgetHost* renderer, bool monitor);
+
#ifdef UNIT_TEST
// When true, the class will not use a timeout to do the expiration. This
// will cause expiration to happen on the next run of the message loop.

Powered by Google App Engine
This is Rietveld 408576698