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

Unified Diff: ui/snapshot/snapshot_hwnd_win.cc

Issue 13926006: Add ui::GrabDesktopSnapshot for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GrabDesktopSnapshot is now available only to tests Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/snapshot/snapshot_hwnd_win.cc
diff --git a/ui/snapshot/snapshot_win.cc b/ui/snapshot/snapshot_hwnd_win.cc
similarity index 88%
copy from ui/snapshot/snapshot_win.cc
copy to ui/snapshot/snapshot_hwnd_win.cc
index 3a8d1e715765722381f8fa8e25592c039427bdb1..61a152ccdc21022e9fb05cb19991d3a042a49ddf 100644
--- a/ui/snapshot/snapshot_win.cc
+++ b/ui/snapshot/snapshot_hwnd_win.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// 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_hwnd_win.h"
#include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h"
@@ -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);
@@ -35,16 +35,11 @@ gfx::Rect GetWindowBounds(gfx::NativeWindow window_handle) {
} // namespace
namespace ui {
+namespace internal {
-bool GrabViewSnapshot(gfx::NativeView view_handle,
+bool GrabHwndSnapshot(HWND window_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(snapshot_bounds.right() <= GetWindowBounds(window_handle).right());
DCHECK(snapshot_bounds.bottom() <= GetWindowBounds(window_handle).bottom());
@@ -103,4 +98,5 @@ bool GrabWindowSnapshot(gfx::NativeWindow window_handle,
return true;
}
+} // namespace internal
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698