| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/thumbnails/thumbnailing_context.h" | 10 #include "chrome/browser/thumbnails/thumbnailing_context.h" |
| 10 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 11 #include "content/public/browser/notification_registrar.h" | 12 #include "content/public/browser/notification_registrar.h" |
| 12 #include "content/public/browser/readback_types.h" | 13 #include "content/public/browser/readback_types.h" |
| 13 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
| 14 #include "content/public/browser/web_contents_user_data.h" | 15 #include "content/public/browser/web_contents_user_data.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class RenderViewHost; | 18 class RenderViewHost; |
| 18 class RenderWidgetHost; | 19 class RenderWidgetHost; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 // content::NotificationObserver overrides. | 33 // content::NotificationObserver overrides. |
| 33 void Observe(int type, | 34 void Observe(int type, |
| 34 const content::NotificationSource& source, | 35 const content::NotificationSource& source, |
| 35 const content::NotificationDetails& details) override; | 36 const content::NotificationDetails& details) override; |
| 36 | 37 |
| 37 // content::WebContentsObserver overrides. | 38 // content::WebContentsObserver overrides. |
| 38 void RenderViewDeleted(content::RenderViewHost* render_view_host) override; | 39 void RenderViewDeleted(content::RenderViewHost* render_view_host) override; |
| 39 void DidStartLoading() override; | 40 void DidStartLoading() override; |
| 40 void NavigationStopped() override; | 41 void NavigationStopped() override; |
| 41 | 42 |
| 42 // Update the thumbnail of the given tab contents if necessary. | 43 void DecrementCapturerCount(); |
| 44 void UpdateThumbnail( |
| 45 const thumbnails::ThumbnailingContext& context, |
| 46 const SkBitmap& thumbnail); |
| 47 void ProcessCapturedBitmap( |
| 48 scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm, |
| 49 const SkBitmap& bitmap, |
| 50 content::ReadbackResponse response); |
| 51 |
| 52 void AsyncProcessThumbnail( |
| 53 scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm); |
| 54 |
| 55 // Update the thumbnail of the given tab contents if necessary. |
| 43 void UpdateThumbnailIfNecessary(content::WebContents* web_contents); | 56 void UpdateThumbnailIfNecessary(content::WebContents* web_contents); |
| 44 | 57 |
| 45 // Called when a render view host was created for a WebContents. | 58 // Called when a render view host was created for a WebContents. |
| 46 void RenderViewHostCreated(content::RenderViewHost* renderer); | 59 void RenderViewHostCreated(content::RenderViewHost* renderer); |
| 47 | 60 |
| 48 // Indicates that the given widget has changed is visibility. | 61 // Indicates that the given widget has changed is visibility. |
| 49 void WidgetHidden(content::RenderWidgetHost* widget); | 62 void WidgetHidden(content::RenderWidgetHost* widget); |
| 50 | 63 |
| 51 content::NotificationRegistrar registrar_; | 64 content::NotificationRegistrar registrar_; |
| 65 scoped_refptr<thumbnails::ThumbnailingContext> thumbnailing_context_; |
| 52 | 66 |
| 53 bool load_interrupted_; | 67 bool load_interrupted_; |
| 54 | 68 |
| 69 base::WeakPtrFactory<ThumbnailTabHelper> weak_factory_; |
| 70 |
| 55 DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelper); | 71 DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelper); |
| 56 }; | 72 }; |
| 57 | 73 |
| 58 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ | 74 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ |
| OLD | NEW |