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

Unified Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 21777003: DevTools: [Android] implement RenderWidgetHostViewAndroid::CopyFromCompositingSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix clang bots. Created 7 years, 4 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: content/browser/web_contents/web_contents_view_aura.cc
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
index 043efca119ab19182f44b386ac8509aebb75a81f..266d5c1720f359aedc9402137514c18cb28e07f3 100644
--- a/content/browser/web_contents/web_contents_view_aura.cc
+++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -58,6 +58,7 @@
#include "ui/gfx/image/image_png_rep.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
+#include "ui/snapshot/snapshot.h"
namespace content {
WebContentsViewPort* CreateWebContentsView(
@@ -1320,6 +1321,17 @@ void WebContentsViewAura::TakeFocus(bool reverse) {
}
}
+bool WebContentsViewAura::GrabSnapshot(const std::string& format,
+ int quality,
+ double scale,
+ std::vector<uint8>* data) {
+ if (format != "png" || scale != 1) {
+ LOG(ERROR) << "Can only capture non-scaled PNG snapshots.";
+ return false;
+ }
+ return ui::GrabViewSnapshot(GetNativeView(), data, GetViewBounds());
+}
+
////////////////////////////////////////////////////////////////////////////////
// WebContentsViewAura, OverscrollControllerDelegate implementation:

Powered by Google App Engine
This is Rietveld 408576698