Chromium Code Reviews| Index: chrome/browser/tab_contents/thumbnail_generator.cc |
| diff --git a/chrome/browser/tab_contents/thumbnail_generator.cc b/chrome/browser/tab_contents/thumbnail_generator.cc |
| index 162094b85936b01bd7cd204243670ba5e27907e1..d16924e379f1d11f769cbb2e37be1fede3edfc32 100644 |
| --- a/chrome/browser/tab_contents/thumbnail_generator.cc |
| +++ b/chrome/browser/tab_contents/thumbnail_generator.cc |
| @@ -502,8 +502,10 @@ void ThumbnailGenerator::UpdateThumbnailIfNecessary( |
| Profile* profile = |
| Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| history::TopSites* top_sites = profile->GetTopSites(); |
| + bool surface_available = |
| + web_contents->GetRenderWidgetHostView()->IsSurfaceAvailableForCopy(); |
| // Skip if we don't need to update the thumbnail. |
| - if (!ShouldUpdateThumbnail(profile, top_sites, url)) |
| + if (!ShouldUpdateThumbnail(profile, top_sites, url, surface_available)) |
|
mazda
2012/05/04 22:20:32
How about just doing as follows?
if (!surface_ava
mmocny
2012/05/07 13:28:23
Yes, it is certainly a bit silly to move the bool
mazda
2012/05/07 16:37:19
We do not plan to use ShouldUpdateThumbnail in oth
|
| return; |
| AsyncUpdateThumbnail(web_contents); |
| @@ -583,7 +585,10 @@ void ThumbnailGenerator::AsyncUpdateThumbnailFinish( |
| bool ThumbnailGenerator::ShouldUpdateThumbnail(Profile* profile, |
| history::TopSites* top_sites, |
| - const GURL& url) { |
| + const GURL& url, |
| + bool surface_available) { |
| + if (!surface_available) |
| + return false; |
| if (!profile || !top_sites) |
| return false; |
| // Skip if it's in the incognito mode. |