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

Unified Diff: content/browser/web_contents/web_contents_view_gtk.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_gtk.cc
diff --git a/content/browser/web_contents/web_contents_view_gtk.cc b/content/browser/web_contents/web_contents_view_gtk.cc
index cdc36c8d11e8d35e377d4d871cfd5115705dc69d..248b289303f51017a6ee8aab7610118a0397b834 100644
--- a/content/browser/web_contents/web_contents_view_gtk.cc
+++ b/content/browser/web_contents/web_contents_view_gtk.cc
@@ -28,6 +28,7 @@
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
+#include "ui/snapshot/snapshot.h"
using WebKit::WebDragOperation;
using WebKit::WebDragOperationsMask;
@@ -301,6 +302,17 @@ void WebContentsViewGtk::TakeFocus(bool reverse) {
}
}
+bool WebContentsViewGtk::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());
+}
+
void WebContentsViewGtk::InsertIntoContentArea(GtkWidget* widget) {
gtk_container_add(GTK_CONTAINER(expanded_.get()), widget);
}

Powered by Google App Engine
This is Rietveld 408576698