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

Unified Diff: ui/snapshot/snapshot_android.cc

Issue 2650903003: Revert of [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: 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
« no previous file with comments | « ui/snapshot/snapshot.cc ('k') | ui/snapshot/snapshot_async.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/snapshot/snapshot_android.cc
diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc
index 3de1f5ad8393824473d20287d1fc6c8d04f42042..f687aa21daf359ba68c44ed1e1943d416f872b36 100644
--- a/ui/snapshot/snapshot_android.cc
+++ b/ui/snapshot/snapshot_android.cc
@@ -24,14 +24,15 @@
// Sync versions are not supported in Android. Callers should fall back
// to the async version.
bool GrabViewSnapshot(gfx::NativeView view,
- const gfx::Rect& snapshot_bounds,
- gfx::Image* image) {
- return GrabWindowSnapshot(view->GetWindowAndroid(), snapshot_bounds, image);
+ std::vector<unsigned char>* png_representation,
+ const gfx::Rect& snapshot_bounds) {
+ return GrabWindowSnapshot(
+ view->GetWindowAndroid(), png_representation, snapshot_bounds);
}
bool GrabWindowSnapshot(gfx::NativeWindow window,
- const gfx::Rect& snapshot_bounds,
- gfx::Image* image) {
+ std::vector<unsigned char>* png_representation,
+ const gfx::Rect& snapshot_bounds) {
return false;
}
@@ -63,20 +64,28 @@
background_task_runner));
}
-void GrabWindowSnapshotAsync(gfx::NativeWindow window,
- const gfx::Rect& source_rect,
- const GrabWindowSnapshotAsyncCallback& callback) {
- MakeAsyncCopyRequest(
- window, source_rect,
- base::Bind(&SnapshotAsync::RunCallbackWithCopyOutputResult, callback));
+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));
}
-void GrabViewSnapshotAsync(gfx::NativeView view,
- const gfx::Rect& source_rect,
- const GrabWindowSnapshotAsyncCallback& callback) {
- MakeAsyncCopyRequest(
- view->GetWindowAndroid(), source_rect,
- base::Bind(&SnapshotAsync::RunCallbackWithCopyOutputResult, callback));
+void GrabViewSnapshotAsync(
+ gfx::NativeView view,
+ const gfx::Rect& source_rect,
+ scoped_refptr<base::TaskRunner> background_task_runner,
+ const GrabWindowSnapshotAsyncPNGCallback& callback) {
+ MakeAsyncCopyRequest(view->GetWindowAndroid(),
+ source_rect,
+ base::Bind(&SnapshotAsync::EncodeCopyOutputResult,
+ callback,
+ background_task_runner));
}
} // namespace ui
« no previous file with comments | « ui/snapshot/snapshot.cc ('k') | ui/snapshot/snapshot_async.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698