Index: ui/snapshot/snapshot_win.cc |
diff --git a/ui/snapshot/snapshot_win.cc b/ui/snapshot/snapshot_win.cc |
index 3a8d1e715765722381f8fa8e25592c039427bdb1..8c2ff3bd5bf93e8f003aa356c8f310967bd3cc1e 100644 |
--- a/ui/snapshot/snapshot_win.cc |
+++ b/ui/snapshot/snapshot_win.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ui/snapshot/snapshot.h" |
+#include "ui/snapshot/snapshot_win.h" |
#include "base/win/scoped_gdi_object.h" |
#include "base/win/scoped_hdc.h" |
@@ -11,10 +11,11 @@ |
#include "ui/gfx/gdi_util.h" |
#include "ui/gfx/rect.h" |
#include "ui/gfx/size.h" |
+#include "ui/snapshot/snapshot.h" |
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); |
@@ -36,15 +37,11 @@ gfx::Rect GetWindowBounds(gfx::NativeWindow window_handle) { |
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); |
-} |
+namespace internal { |
-bool GrabWindowSnapshot(gfx::NativeWindow window_handle, |
- std::vector<unsigned char>* png_representation, |
- const gfx::Rect& snapshot_bounds) { |
+bool GrabHwndSnapshot(HWND window_handle, |
+ const gfx::Rect& snapshot_bounds, |
+ std::vector<unsigned char>* png_representation) { |
DCHECK(snapshot_bounds.right() <= GetWindowBounds(window_handle).right()); |
DCHECK(snapshot_bounds.bottom() <= GetWindowBounds(window_handle).bottom()); |
@@ -103,4 +100,22 @@ bool GrabWindowSnapshot(gfx::NativeWindow window_handle, |
return true; |
} |
+} // namespace internal |
+ |
+#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 internal::GrabHwndSnapshot(window_handle, snapshot_bounds, |
+ png_representation); |
+} |
+#endif // !defined(USE_AURA) |
+ |
} // namespace ui |