Index: ui/snapshot/snapshot_win.cc |
diff --git a/ui/snapshot/snapshot_win.cc b/ui/snapshot/snapshot_win.cc |
index 3a8d1e715765722381f8fa8e25592c039427bdb1..90d2248dd5047262e333a34824daf17d011c8c19 100644 |
--- a/ui/snapshot/snapshot_win.cc |
+++ b/ui/snapshot/snapshot_win.cc |
@@ -14,7 +14,7 @@ |
namespace { |
-gfx::Rect GetWindowBounds(gfx::NativeWindow window_handle) { |
+gfx::Rect GetWindowBounds(HWND window_handle) { |
RECT content_rect = {0, 0, 0, 0}; |
if (window_handle) { |
::GetWindowRect(window_handle, &content_rect); |
@@ -32,19 +32,9 @@ gfx::Rect GetWindowBounds(gfx::NativeWindow window_handle) { |
content_rect.bottom - content_rect.top); |
} |
-} // namespace |
- |
-namespace ui { |
- |
-bool GrabViewSnapshot(gfx::NativeView view_handle, |
- std::vector<unsigned char>* png_representation, |
- const gfx::Rect& snapshot_bounds) { |
- return GrabWindowSnapshot(view_handle, png_representation, snapshot_bounds); |
-} |
- |
-bool GrabWindowSnapshot(gfx::NativeWindow window_handle, |
- std::vector<unsigned char>* png_representation, |
- const gfx::Rect& snapshot_bounds) { |
+bool GrabWindowSnapshotImpl(HWND window_handle, |
+ std::vector<unsigned char>* png_representation, |
+ const gfx::Rect& snapshot_bounds) { |
DCHECK(snapshot_bounds.right() <= GetWindowBounds(window_handle).right()); |
DCHECK(snapshot_bounds.bottom() <= GetWindowBounds(window_handle).bottom()); |
@@ -103,4 +93,31 @@ bool GrabWindowSnapshot(gfx::NativeWindow window_handle, |
return true; |
} |
+} // namespace |
+ |
+namespace ui { |
+ |
+#if !defined(USE_AURA) |
+ |
+bool GrabViewSnapshot(gfx::NativeView view_handle, |
+ std::vector<unsigned char>* png_representation, |
+ const gfx::Rect& snapshot_bounds) { |
+ return GrabWindowSnapshot(view_handle, png_representation, snapshot_bounds); |
+} |
+ |
+bool GrabWindowSnapshot(gfx::NativeWindow window_handle, |
+ std::vector<unsigned char>* png_representation, |
+ const gfx::Rect& snapshot_bounds) { |
+ DCHECK(window_handle); |
+ return GrabWindowSnapshotImpl(window_handle, png_representation, |
+ snapshot_bounds); |
+} |
+ |
+#endif // !defined(USE_AURA) |
+ |
+bool GrabDesktopSnapshot(std::vector<unsigned char>* png_representation, |
+ const gfx::Rect& snapshot_bounds) { |
+ return GrabWindowSnapshotImpl(NULL, png_representation, snapshot_bounds); |
+} |
+ |
} // namespace ui |