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

Unified Diff: ui/snapshot/snapshot_android.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_android.cc
diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc
index 557a325db03b1682b79613561520a3070ea4bfb0..f32ca461169c15f6c537d5cbd09a2ee5e246fec1 100644
--- a/ui/snapshot/snapshot_android.cc
+++ b/ui/snapshot/snapshot_android.cc
@@ -23,14 +23,18 @@ namespace ui {
bool GrabViewSnapshot(gfx::NativeView view,
std::vector<unsigned char>* png_representation,
- const gfx::Rect& snapshot_bounds) {
- return GrabWindowSnapshot(
- view->GetWindowAndroid(), png_representation, snapshot_bounds);
+ const gfx::Rect& snapshot_bounds,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
+ return GrabWindowSnapshot(view->GetWindowAndroid(), 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 Android. Callers should fall back to the async version.
return false;
}
@@ -79,21 +83,24 @@ void GrabWindowSnapshotAsync(
gfx::NativeWindow window,
const gfx::Rect& source_rect,
scoped_refptr<base::TaskRunner> background_task_runner,
- const GrabWindowSnapshotAsyncPNGCallback& callback) {
- MakeAsyncCopyRequest(window,
- source_rect,
- base::Bind(&SnapshotAsync::EncodeCopyOutputResult,
- callback,
- background_task_runner));
+ const GrabWindowSnapshotAsyncEncodedCallback& callback,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
+ MakeAsyncCopyRequest(
+ 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->GetWindowAndroid(), source_rect, background_task_runner, callback);
+ const GrabWindowSnapshotAsyncEncodedCallback& callback,
+ SnapshotEncoding encoding,
+ SnapshotQuality quality) {
+ GrabWindowSnapshotAsync(view->GetWindowAndroid(), source_rect,
+ background_task_runner, callback, encoding, quality);
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698