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

Side by Side Diff: ui/snapshot/snapshot_ios.mm

Issue 2592983002: [devtools] Support different encodings for Page.CaptureScreenshot. (Closed)
Patch Set: Encode in ui snapshot methods instead. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/snapshot/snapshot.h" 5 #include "ui/snapshot/snapshot.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "ui/gfx/geometry/rect.h" 8 #include "ui/gfx/geometry/rect.h"
9 #include "ui/gfx/image/image.h" 9 #include "ui/gfx/image/image.h"
10 10
11 namespace ui { 11 namespace ui {
12 12
13 bool GrabViewSnapshot(gfx::NativeView view, 13 bool GrabViewSnapshot(gfx::NativeView view,
14 std::vector<unsigned char>* png_representation, 14 std::vector<unsigned char>* png_representation,
15 const gfx::Rect& snapshot_bounds) { 15 const gfx::Rect& snapshot_bounds,
16 SnapshotEncoding encoding,
17 SnapshotQuality quality) {
16 // TODO(bajones): Implement iOS snapshot functionality 18 // TODO(bajones): Implement iOS snapshot functionality
17 return false; 19 return false;
18 } 20 }
19 21
20 bool GrabWindowSnapshot(gfx::NativeWindow window, 22 bool GrabWindowSnapshot(gfx::NativeWindow window,
21 std::vector<unsigned char>* png_representation, 23 std::vector<unsigned char>* png_representation,
22 const gfx::Rect& snapshot_bounds) { 24 const gfx::Rect& snapshot_bounds,
25 SnapshotEncoding encoding,
26 SnapshotQuality quality) {
23 // TODO(bajones): Implement iOS snapshot functionality 27 // TODO(bajones): Implement iOS snapshot functionality
24 return false; 28 return false;
25 } 29 }
26 30
27 void GrabWindowSnapshotAndScaleAsync( 31 void GrabWindowSnapshotAndScaleAsync(
28 gfx::NativeWindow window, 32 gfx::NativeWindow window,
29 const gfx::Rect& snapshot_bounds, 33 const gfx::Rect& snapshot_bounds,
30 const gfx::Size& target_size, 34 const gfx::Size& target_size,
31 scoped_refptr<base::TaskRunner> background_task_runner, 35 scoped_refptr<base::TaskRunner> background_task_runner,
32 GrabWindowSnapshotAsyncCallback callback) { 36 GrabWindowSnapshotAsyncCallback callback) {
33 callback.Run(gfx::Image()); 37 callback.Run(gfx::Image());
34 } 38 }
35 39
36 void GrabViewSnapshotAsync( 40 void GrabViewSnapshotAsync(
37 gfx::NativeView view, 41 gfx::NativeView view,
38 const gfx::Rect& source_rect, 42 const gfx::Rect& source_rect,
39 scoped_refptr<base::TaskRunner> background_task_runner, 43 scoped_refptr<base::TaskRunner> background_task_runner,
40 const GrabWindowSnapshotAsyncPNGCallback& callback) { 44 const GrabWindowSnapshotAsyncEncodedCallback& callback,
45 SnapshotEncoding encoding,
46 SnapshotQuality quality) {
41 callback.Run(scoped_refptr<base::RefCountedBytes>()); 47 callback.Run(scoped_refptr<base::RefCountedBytes>());
42 } 48 }
43 49
44 void GrabWindowSnapshotAsync( 50 void GrabWindowSnapshotAsync(
45 gfx::NativeWindow window, 51 gfx::NativeWindow window,
46 const gfx::Rect& source_rect, 52 const gfx::Rect& source_rect,
47 scoped_refptr<base::TaskRunner> background_task_runner, 53 scoped_refptr<base::TaskRunner> background_task_runner,
48 const GrabWindowSnapshotAsyncPNGCallback& callback) { 54 const GrabWindowSnapshotAsyncEncodedCallback& callback,
55 SnapshotEncoding encoding,
56 SnapshotQuality quality) {
49 callback.Run(scoped_refptr<base::RefCountedBytes>()); 57 callback.Run(scoped_refptr<base::RefCountedBytes>());
50 } 58 }
51 59
52 } // namespace ui 60 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698