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

Unified Diff: ui/snapshot/snapshot_aura.cc

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: Encode in ui snapshot methods instead. Created 3 years, 12 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: ui/snapshot/snapshot_aura.cc
diff --git a/ui/snapshot/snapshot_aura.cc b/ui/snapshot/snapshot_aura.cc
index d2df3f08f2aee04e22bc93ee62bd50ef7a0a145c..49d9d5adf6c5fb66e6ea92745d10be075b1bb6ce 100644
--- a/ui/snapshot/snapshot_aura.cc
+++ b/ui/snapshot/snapshot_aura.cc
@@ -23,13 +23,18 @@ namespace ui {
bool GrabViewSnapshot(gfx::NativeView view,
std::vector<unsigned char>* png_representation,
- const gfx::Rect& snapshot_bounds) {
- return GrabWindowSnapshot(view, png_representation, snapshot_bounds);
+ const gfx::Rect& snapshot_bounds,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
+ return GrabWindowSnapshot(view, png_representation, snapshot_bounds, encoding,
+ quality);
}
bool GrabWindowSnapshot(gfx::NativeWindow window,
std::vector<unsigned char>* png_representation,
- const gfx::Rect& snapshot_bounds) {
+ const gfx::Rect& snapshot_bounds,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
// Not supported in Aura. Callers should fall back to the async version.
return false;
}
@@ -98,18 +103,24 @@ void GrabWindowSnapshotAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
scoped_refptr<base::TaskRunner> background_task_runner,
- const GrabWindowSnapshotAsyncPNGCallback& callback) {
- MakeInitialAsyncCopyRequest(window, source_rect,
- base::Bind(&SnapshotAsync::EncodeCopyOutputResult,
- callback, background_task_runner));
+ const GrabWindowSnapshotAsyncEncodedCallback& callback,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
+ MakeInitialAsyncCopyRequest(
+ window, source_rect,
+ base::Bind(&SnapshotAsync::EncodeCopyOutputResult, callback,
+ background_task_runner, encoding, quality));
}
void GrabViewSnapshotAsync(
gfx::NativeView view,
const gfx::Rect& source_rect,
scoped_refptr<base::TaskRunner> background_task_runner,
- const GrabWindowSnapshotAsyncPNGCallback& callback) {
- GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback);
+ const GrabWindowSnapshotAsyncEncodedCallback& callback,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
+ GrabWindowSnapshotAsync(view, source_rect, background_task_runner, callback,
+ encoding, quality);
}

Powered by Google App Engine
This is Rietveld 408576698