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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: Disabled test on MacOS >=10.11, added ref to bug. Created 3 years, 11 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/renderer_host/render_widget_host_impl.h
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
index 60cca7c752765ef0687868539dd2900191d0d945..4e90a82e3ff7c493ee1623d921046360111b7fa8 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -53,10 +53,6 @@ struct FrameHostMsg_HittestData_Params;
struct ViewHostMsg_SelectionBounds_Params;
struct ViewHostMsg_UpdateRect_Params;
-namespace base {
-class RefCountedBytes;
-}
-
namespace blink {
class WebInputEvent;
class WebMouseEvent;
@@ -70,6 +66,7 @@ class PowerSaveBlocker;
#endif
namespace gfx {
+class Image;
class Range;
}
@@ -208,9 +205,12 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
void NotifyScreenInfoChanged();
// Forces redraw in the renderer and when the update reaches the browser
- // grabs snapshot from the compositor. Returns PNG-encoded snapshot.
+ // grabs snapshot from the compositor. On MacOS, the snapshot is taken from
+ // the Cocoa view for end-to-end testing purposes. Returns a gfx::Image that
+ // is backed by an NSImage on MacOS or by an SkBitmap otherwise. The
+ // gfx::Image may be empty if the snapshot failed.
using GetSnapshotFromBrowserCallback =
- base::Callback<void(const unsigned char*, size_t)>;
+ base::Callback<void(const gfx::Image&)>;
void GetSnapshotFromBrowser(const GetSnapshotFromBrowserCallback& callback);
const NativeWebKeyboardEvent* GetLastKeyboardEvent() const;
@@ -701,13 +701,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl : public RenderWidgetHost,
void WindowSnapshotReachedScreen(int snapshot_id);
- void OnSnapshotDataReceived(int snapshot_id,
- const unsigned char* png,
- size_t size);
-
- void OnSnapshotDataReceivedAsync(
- int snapshot_id,
- scoped_refptr<base::RefCountedBytes> png_data);
+ void OnSnapshotReceived(int snapshot_id, const gfx::Image& image);
// 1. Grants permissions to URL (if any)
// 2. Grants permissions to filenames
« no previous file with comments | « content/browser/devtools/protocol/page_handler.cc ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698