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 |
43 // 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.
| |
44 void CleanUpFromThumbnailGeneration(); | |
45 | |
46 // Pass the thumbnail to the thumbnail service. | |
47 void UpdateThumbnail( | |
48 const thumbnails::ThumbnailingContext& context, | |
49 const SkBitmap& thumbnail); | |
50 | |
51 // Create a thumbnail from the web contents bitmap. | |
52 void ProcessCapturedBitmap( | |
53 scoped_refptr<thumbnails::ThumbnailingAlgorithm> algorithm, | |
54 const SkBitmap& bitmap, | |
55 content::ReadbackResponse response); | |
56 | |
57 // Initiate asynchronous generation of a thumbnail from the web contents. | |
58 void AsyncProcessThumbnail( | |
59 scoped_refptr<thumbnails::ThumbnailService> thumbnail_service); | |
60 | |
42 // Update the thumbnail of the given tab contents if necessary. | 61 // Update the thumbnail of the given tab contents if necessary. |
43 void UpdateThumbnailIfNecessary(content::WebContents* web_contents); | 62 void UpdateThumbnailIfNecessary(); |
44 | 63 |
45 // Called when a render view host was created for a WebContents. | 64 // Called when a render view host was created for a WebContents. |
46 void RenderViewHostCreated(content::RenderViewHost* renderer); | 65 void RenderViewHostCreated(content::RenderViewHost* renderer); |
47 | 66 |
48 // Indicates that the given widget has changed is visibility. | 67 // Indicates that the given widget has changed is visibility. |
49 void WidgetHidden(content::RenderWidgetHost* widget); | 68 void WidgetHidden(content::RenderWidgetHost* widget); |
50 | 69 |
51 content::NotificationRegistrar registrar_; | 70 content::NotificationRegistrar registrar_; |
71 scoped_refptr<thumbnails::ThumbnailingContext> thumbnailing_context_; | |
52 | 72 |
53 bool load_interrupted_; | 73 bool load_interrupted_; |
54 | 74 |
75 base::WeakPtrFactory<ThumbnailTabHelper> weak_factory_; | |
76 | |
55 DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelper); | 77 DISALLOW_COPY_AND_ASSIGN(ThumbnailTabHelper); |
56 }; | 78 }; |
57 | 79 |
58 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ | 80 #endif // CHROME_BROWSER_THUMBNAILS_THUMBNAIL_TAB_HELPER_H_ |
OLD | NEW |