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

Side by Side Diff: ui/snapshot/snapshot.h

Issue 119753007: Add GrabWindowSnapshotAsync tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased, compiling Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/keyboard/keyboard_controller_unittest.cc ('k') | ui/snapshot/snapshot_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef UI_SNAPSHOT_SNAPSHOT_H_ 5 #ifndef UI_SNAPSHOT_SNAPSHOT_H_
6 #define UI_SNAPSHOT_SNAPSHOT_H_ 6 #define UI_SNAPSHOT_SNAPSHOT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 10 matching lines...) Expand all
21 class Image; 21 class Image;
22 class Size; 22 class Size;
23 } 23 }
24 24
25 namespace ui { 25 namespace ui {
26 26
27 // Grabs a snapshot of the window/view. No security checks are done. This is 27 // Grabs a snapshot of the window/view. No security checks are done. This is
28 // intended to be used for debugging purposes where no BrowserProcess instance 28 // intended to be used for debugging purposes where no BrowserProcess instance
29 // is available (ie. tests). This function is synchronous, so it should NOT be 29 // is available (ie. tests). This function is synchronous, so it should NOT be
30 // used in a result of user action. Use asynchronous GrabWindowSnapshotAsync() 30 // used in a result of user action. Use asynchronous GrabWindowSnapshotAsync()
31 // instead. 31 // instead on supported platforms.
32 SNAPSHOT_EXPORT bool GrabWindowSnapshot( 32 SNAPSHOT_EXPORT bool GrabWindowSnapshot(
33 gfx::NativeWindow window, 33 gfx::NativeWindow window,
34 std::vector<unsigned char>* png_representation, 34 std::vector<unsigned char>* png_representation,
35 const gfx::Rect& snapshot_bounds); 35 const gfx::Rect& snapshot_bounds);
36 36
37 SNAPSHOT_EXPORT bool GrabViewSnapshot( 37 SNAPSHOT_EXPORT bool GrabViewSnapshot(
38 gfx::NativeView view, 38 gfx::NativeView view,
39 std::vector<unsigned char>* png_representation, 39 std::vector<unsigned char>* png_representation,
40 const gfx::Rect& snapshot_bounds); 40 const gfx::Rect& snapshot_bounds);
41 41
42 // GrabWindowSnapshotAsync() copies snapshot of |source_rect| from window and
43 // scales it to |target_size| asynchronously.
44 typedef base::Callback<void(const gfx::Image& snapshot)> 42 typedef base::Callback<void(const gfx::Image& snapshot)>
45 GrabWindowSnapshotAsyncCallback; 43 GrabWindowSnapshotAsyncCallback;
46 SNAPSHOT_EXPORT void GrabWindowSnapshotAsync( 44 // GrabWindowSnapshotAndScaleAsync() copies snapshot of |source_rect| from
45 // window and scales it to |target_size| asynchronously.
46 SNAPSHOT_EXPORT void GrabWindowSnapshotAndScaleAsync(
47 gfx::NativeWindow window, 47 gfx::NativeWindow window,
48 const gfx::Rect& source_rect, 48 const gfx::Rect& source_rect,
49 const gfx::Size& target_size, 49 const gfx::Size& target_size,
50 scoped_refptr<base::TaskRunner> background_task_runner, 50 scoped_refptr<base::TaskRunner> background_task_runner,
51 const GrabWindowSnapshotAsyncCallback& callback); 51 const GrabWindowSnapshotAsyncCallback& callback);
52 SNAPSHOT_EXPORT void GrabWindowSnapshotAsync(
53 gfx::NativeWindow window,
54 const gfx::Rect& source_rect,
55 scoped_refptr<base::TaskRunner> background_task_runner,
56 const GrabWindowSnapshotAsyncCallback& callback);
52 57
53 } // namespace ui 58 } // namespace ui
54 59
55 #endif // UI_SNAPSHOT_SNAPSHOT_H_ 60 #endif // UI_SNAPSHOT_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_controller_unittest.cc ('k') | ui/snapshot/snapshot_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698