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

Unified Diff: content/browser/web_contents/web_contents_view_win.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_win.cc
diff --git a/content/browser/web_contents/web_contents_view_win.cc b/content/browser/web_contents/web_contents_view_win.cc
index 6a75e71cab560b7163154516bd6281b852b216cd..f84bd3366bd93764b989a290abd8a816fd853829 100644
--- a/content/browser/web_contents/web_contents_view_win.cc
+++ b/content/browser/web_contents/web_contents_view_win.cc
@@ -18,6 +18,7 @@
#include "ui/base/win/hidden_window.h"
#include "ui/base/win/hwnd_subclass.h"
#include "ui/gfx/screen.h"
+#include "ui/snapshot/snapshot.h"
namespace content {
WebContentsViewPort* CreateWebContentsView(
@@ -289,6 +290,17 @@ void WebContentsViewWin::TakeFocus(bool reverse) {
}
}
+bool WebContentsViewWin::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 WebContentsViewWin::EndDragging() {
drag_handler_ = NULL;
web_contents_->SystemDragEnded();

Powered by Google App Engine
This is Rietveld 408576698