OLD | NEW |
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_win.h" | 5 #include "ui/snapshot/snapshot_win.h" |
6 | 6 |
| 7 #include "base/callback.h" |
7 #include "base/win/scoped_gdi_object.h" | 8 #include "base/win/scoped_gdi_object.h" |
8 #include "base/win/scoped_hdc.h" | 9 #include "base/win/scoped_hdc.h" |
9 #include "base/win/scoped_select_object.h" | 10 #include "base/win/scoped_select_object.h" |
10 #include "ui/gfx/codec/png_codec.h" | 11 #include "ui/gfx/codec/png_codec.h" |
11 #include "ui/gfx/gdi_util.h" | 12 #include "ui/gfx/gdi_util.h" |
12 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
13 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
14 #include "ui/snapshot/snapshot.h" | 15 #include "ui/snapshot/snapshot.h" |
15 | 16 |
16 namespace { | 17 namespace { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 png_representation); | 97 png_representation); |
97 | 98 |
98 ReleaseDC(window_handle, window_hdc); | 99 ReleaseDC(window_handle, window_hdc); |
99 | 100 |
100 return true; | 101 return true; |
101 } | 102 } |
102 | 103 |
103 } // namespace internal | 104 } // namespace internal |
104 | 105 |
105 #if !defined(USE_AURA) | 106 #if !defined(USE_AURA) |
| 107 |
106 bool GrabViewSnapshot(gfx::NativeView view_handle, | 108 bool GrabViewSnapshot(gfx::NativeView view_handle, |
107 std::vector<unsigned char>* png_representation, | 109 std::vector<unsigned char>* png_representation, |
108 const gfx::Rect& snapshot_bounds) { | 110 const gfx::Rect& snapshot_bounds) { |
109 return GrabWindowSnapshot(view_handle, png_representation, snapshot_bounds); | 111 return GrabWindowSnapshot(view_handle, png_representation, snapshot_bounds); |
110 } | 112 } |
111 | 113 |
112 bool GrabWindowSnapshot(gfx::NativeWindow window_handle, | 114 bool GrabWindowSnapshot(gfx::NativeWindow window_handle, |
113 std::vector<unsigned char>* png_representation, | 115 std::vector<unsigned char>* png_representation, |
114 const gfx::Rect& snapshot_bounds) { | 116 const gfx::Rect& snapshot_bounds) { |
115 DCHECK(window_handle); | 117 DCHECK(window_handle); |
116 return internal::GrabHwndSnapshot(window_handle, snapshot_bounds, | 118 return internal::GrabHwndSnapshot(window_handle, snapshot_bounds, |
117 png_representation); | 119 png_representation); |
118 } | 120 } |
| 121 |
| 122 SNAPSHOT_EXPORT void GrapWindowSnapshotAsync( |
| 123 gfx::NativeWindow window, |
| 124 const gfx::Rect& snapshot_bounds, |
| 125 const gfx::Size& target_size, |
| 126 scoped_refptr<base::TaskRunner> background_task_runner, |
| 127 GrapWindowSnapshotAsyncCallback callback) { |
| 128 NOTIMPLEMENTED(); |
| 129 } |
| 130 |
119 #endif // !defined(USE_AURA) | 131 #endif // !defined(USE_AURA) |
120 | 132 |
121 } // namespace ui | 133 } // namespace ui |
OLD | NEW |