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

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

Issue 12746009: Revert 189969 "Add RenderWidgetHost::GetSnapshotFromRenderer met..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1450/src/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/ui/browser_tab_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/thumbnails/thumbnail_tab_helper.cc
===================================================================
--- chrome/browser/thumbnails/thumbnail_tab_helper.cc (revision 190011)
+++ chrome/browser/thumbnails/thumbnail_tab_helper.cc (working copy)
@@ -73,13 +73,6 @@
algorithm->ProcessBitmap(context, base::Bind(&UpdateThumbnail), bitmap);
}
-void GotSnapshotFromRenderer(base::Callback<void(const SkBitmap&)> callback,
- bool success,
- const SkBitmap& bitmap) {
- if (success)
- callback.Run(bitmap);
-}
-
void AsyncProcessThumbnail(content::WebContents* web_contents,
scoped_refptr<ThumbnailingContext> context,
scoped_refptr<ThumbnailingAlgorithm> algorithm) {
@@ -89,15 +82,21 @@
if (!view)
return;
if (!view->IsSurfaceAvailableForCopy()) {
- // On Windows XP and possibly due to driver issues, neither the backing
- // store nor the compositing surface is available in the browser when
- // accelerated compositing is active, so ask the renderer to send a snapshot
- // for creating the thumbnail.
- render_widget_host->GetSnapshotFromRenderer(
- gfx::Rect(),
- base::Bind(GotSnapshotFromRenderer, base::Bind(
- &ThumbnailingAlgorithm::ProcessBitmap,
- algorithm, context, base::Bind(&UpdateThumbnail))));
+#if defined(OS_WIN)
+ // On Windows XP, neither the backing store nor the compositing surface is
+ // available in the browser when accelerated compositing is active, so ask
+ // the renderer to send a snapshot for creating the thumbnail.
+ if (base::win::GetVersion() < base::win::VERSION_VISTA) {
+ gfx::Size view_size =
+ render_widget_host->GetView()->GetViewBounds().size();
+ g_browser_process->GetRenderWidgetSnapshotTaker()->AskForSnapshot(
+ render_widget_host,
+ base::Bind(&ThumbnailingAlgorithm::ProcessBitmap,
+ algorithm, context, base::Bind(&UpdateThumbnail)),
+ view_size,
+ view_size);
+ }
+#endif
return;
}
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | chrome/browser/ui/browser_tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698