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

Unified Diff: content/shell/test_runner/pixel_dump.h

Issue 2963593002: Split DumpPixelsAsync in pixel_dump.h into more granular functions. (Closed)
Patch Set: Addressed CR feedback from alexmos@. Created 3 years, 5 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
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | content/shell/test_runner/pixel_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/test_runner/pixel_dump.h
diff --git a/content/shell/test_runner/pixel_dump.h b/content/shell/test_runner/pixel_dump.h
index a6c0a8a597abff305c1fe8da6a2c68f5a02e7a52..9a2edb93c3b8fe48ada110500e5bffb3265d3804 100644
--- a/content/shell/test_runner/pixel_dump.h
+++ b/content/shell/test_runner/pixel_dump.h
@@ -6,34 +6,43 @@
#define CONTENT_SHELL_TEST_RUNNER_PIXEL_DUMP_H_
#include "base/callback_forward.h"
-#include "content/shell/test_runner/test_runner_export.h"
class SkBitmap;
namespace blink {
-class WebView;
+class WebLocalFrame;
} // namespace blink
namespace test_runner {
-class LayoutTestRuntimeFlags;
-
-// Dumps image snapshot of |web_view|. Exact dump mode depends on |flags| (i.e.
-// dump_selection_rect and/or is_printing). Caller needs to ensure that
-// |layout_test_runtime_flags| stays alive until |callback| gets called.
-TEST_RUNNER_EXPORT void DumpPixelsAsync(
- blink::WebView* web_view,
- const LayoutTestRuntimeFlags& layout_test_runtime_flags,
- float device_scale_factor_for_test,
- const base::Callback<void(const SkBitmap&)>& callback);
-
-// Copy to clipboard the image present at |x|, |y| coordinates in |web_view|
+// Asks |web_frame|'s widget to dump its pixels and calls |callback| with the
+// result.
+void DumpPixelsAsync(blink::WebLocalFrame* web_frame,
+ float device_scale_factor_for_test,
+ base::OnceCallback<void(const SkBitmap&)> callback);
+
+// Asks |web_frame| to print itself and calls |callback| with the result.
+void PrintFrameAsync(blink::WebLocalFrame* web_frame,
+ base::OnceCallback<void(const SkBitmap&)> callback);
+
+// Captures the current selection bounds rect of |web_frame| and creates a
+// callback that will draw the rect (if any) on top of the |original_bitmap|,
+// before passing |bitmap_with_selection_bounds_rect| to the
+// |original_callback|. Selection bounds rect is the rect enclosing the
+// (possibly transformed) selection.
+base::OnceCallback<void(const SkBitmap& original_bitmap)>
+CreateSelectionBoundsRectDrawingCallback(
+ blink::WebLocalFrame* web_frame,
+ base::OnceCallback<void(const SkBitmap& bitmap_with_selection_bounds_rect)>
+ original_callback);
+
+// Copy to clipboard the image present at |x|, |y| coordinates in |web_frame|
// and pass the captured image to |callback|.
void CopyImageAtAndCapturePixels(
- blink::WebView* web_view,
+ blink::WebLocalFrame* web_frame,
int x,
int y,
- const base::Callback<void(const SkBitmap&)>& callback);
+ base::OnceCallback<void(const SkBitmap&)> callback);
} // namespace test_runner
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | content/shell/test_runner/pixel_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698