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

Unified Diff: content/browser/web_contents/web_contents_view_mac.mm

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_mac.mm
diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm
index 6a9459d3e95c487ad9d53e0186ca247c2505dc1f..9449220cc157c7d88440e966559b235fc6960ae8 100644
--- a/content/browser/web_contents/web_contents_view_mac.mm
+++ b/content/browser/web_contents/web_contents_view_mac.mm
@@ -27,6 +27,7 @@
#import "ui/base/cocoa/focus_tracker.h"
#include "ui/base/dragdrop/cocoa_dnd_util.h"
#include "ui/gfx/image/image_skia_util_mac.h"
+#include "ui/snapshot/snapshot.h"
using WebKit::WebDragOperation;
using WebKit::WebDragOperationsMask;
@@ -228,6 +229,17 @@ void WebContentsViewMac::TakeFocus(bool reverse) {
}
}
+bool WebContentsViewMac::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 WebContentsViewMac::ShowContextMenu(const ContextMenuParams& params) {
// Allow delegates to handle the context menu operation first.
if (web_contents_->GetDelegate() &&

Powered by Google App Engine
This is Rietveld 408576698