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

Unified Diff: ui/snapshot/snapshot_win.cc

Issue 606453002: Remove implicit HANDLE conversions from ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « ui/native_theme/native_theme_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/snapshot/snapshot_win.cc
diff --git a/ui/snapshot/snapshot_win.cc b/ui/snapshot/snapshot_win.cc
index 29a6be205484bd58fb8ba417b6705ed59a18dbe3..fff9705e0707d4d0dbb2db13212acec87e13a8f1 100644
--- a/ui/snapshot/snapshot_win.cc
+++ b/ui/snapshot/snapshot_win.cc
@@ -56,18 +56,18 @@ bool GrabHwndSnapshot(HWND window_handle,
&hdr);
unsigned char *bit_ptr = NULL;
base::win::ScopedBitmap bitmap(
- CreateDIBSection(mem_hdc,
+ CreateDIBSection(mem_hdc.Get(),
reinterpret_cast<BITMAPINFO*>(&hdr),
DIB_RGB_COLORS,
reinterpret_cast<void **>(&bit_ptr),
NULL, 0));
- base::win::ScopedSelectObject select_bitmap(mem_hdc, bitmap);
+ base::win::ScopedSelectObject select_bitmap(mem_hdc.Get(), 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
// bit of space.
- PatBlt(mem_hdc, 0, 0, snapshot_bounds.width(), snapshot_bounds.height(),
+ PatBlt(mem_hdc.Get(), 0, 0, snapshot_bounds.width(), snapshot_bounds.height(),
WHITENESS);
// Grab a copy of the window
// First, see if PrintWindow is defined (it's not in Windows 2000).
@@ -82,10 +82,11 @@ bool GrabHwndSnapshot(HWND window_handle,
// than nothing and will work fine in the average case (window is
// completely on screen). Always BitBlt when grabbing the whole screen.
if (snapshot_bounds.origin() == gfx::Point() && print_window && window_handle)
- (*print_window)(window_handle, mem_hdc, 0);
+ (*print_window)(window_handle, mem_hdc.Get(), 0);
else
- BitBlt(mem_hdc, 0, 0, snapshot_bounds.width(), snapshot_bounds.height(),
- window_hdc, snapshot_bounds.x(), snapshot_bounds.y(), SRCCOPY);
+ BitBlt(mem_hdc.Get(), 0, 0, snapshot_bounds.width(),
+ snapshot_bounds.height(), window_hdc, snapshot_bounds.x(),
+ snapshot_bounds.y(), SRCCOPY);
// We now have a copy of the window contents in a DIB, so
// encode it into a useful format for posting to the bug report
« no previous file with comments | « ui/native_theme/native_theme_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698