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

Unified Diff: chrome/browser/ui/window_snapshot/window_snapshot_win.cc

Issue 8139022: Rename ScopedHDC to ScopedCreateDC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update a comment of ScopedCreateDC Created 9 years, 2 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: chrome/browser/ui/window_snapshot/window_snapshot_win.cc
diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_win.cc b/chrome/browser/ui/window_snapshot/window_snapshot_win.cc
index 0885c7bd8e93194f38f73915b99d73ea05eba52b..2d30dad10448a85de52ee78e09d2db276d06fd43 100644
--- a/chrome/browser/ui/window_snapshot/window_snapshot_win.cc
+++ b/chrome/browser/ui/window_snapshot/window_snapshot_win.cc
@@ -6,6 +6,7 @@
#include "base/win/scoped_gdi_object.h"
#include "base/win/scoped_hdc.h"
+#include "base/win/scoped_select_object.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/rect.h"
@@ -17,7 +18,7 @@ gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window_handle,
std::vector<unsigned char>* png_representation) {
// Create a memory DC that's compatible with the window.
HDC window_hdc = GetWindowDC(window_handle);
- base::win::ScopedHDC mem_hdc(CreateCompatibleDC(window_hdc));
+ base::win::ScopedCreateDC mem_hdc(CreateCompatibleDC(window_hdc));
// Create a DIB that's the same size as the window.
RECT content_rect = {0, 0, 0, 0};
@@ -35,7 +36,7 @@ gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window_handle,
reinterpret_cast<void **>(&bit_ptr),
NULL, 0));
- SelectObject(mem_hdc, bitmap);
+ base::win::ScopedSelectObject select_bitmap(mem_hdc, bitmap);
// Clear the bitmap to white (so that rounded corners on windows
// show up on a white background, and strangely-shaped windows
// look reasonable). Not capturing an alpha mask saves a

Powered by Google App Engine
This is Rietveld 408576698