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

Unified Diff: ui/native_theme/native_theme_win.cc

Issue 1406403007: Eliminate HICON leaks caused by creating icons from bitmap image. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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/gfx/platform_font_win.cc ('k') | ui/views/controls/menu/menu_config_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_win.cc
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 91834768ca11e4528cb6a60c72c943951c4a227c..3f8fb05beba67acfc6aa2672b20b2f7a7c801bc3 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -877,7 +877,7 @@ HRESULT NativeThemeWin::PaintMenuArrow(
base::win::ScopedCreateDC mem_dc(CreateCompatibleDC(hdc));
base::win::ScopedBitmap mem_bitmap(CreateCompatibleBitmap(hdc, r.width(),
r.height()));
- base::win::ScopedSelectObject select_bitmap(mem_dc.Get(), mem_bitmap);
+ base::win::ScopedSelectObject select_bitmap(mem_dc.Get(), mem_bitmap.get());
// Copy and horizontally mirror the background from hdc into mem_dc. Use
// a negative-width source rect, starting at the rightmost pixel.
StretchBlt(mem_dc.Get(), 0, 0, r.width(), r.height(),
@@ -1604,8 +1604,9 @@ HRESULT NativeThemeWin::PaintTextField(HDC hdc,
DrawEdge(hdc, rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
if (fill_content_area) {
- FillRect(hdc, rect, (classic_state & DFCS_INACTIVE) ?
- reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1) : bg_brush);
+ FillRect(hdc, rect, (classic_state & DFCS_INACTIVE)
+ ? reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1)
+ : bg_brush.get());
}
return S_OK;
}
@@ -1625,7 +1626,7 @@ HRESULT NativeThemeWin::PaintTextField(HDC hdc,
RECT content_rect;
hr = get_theme_content_rect_(handle, hdc, part_id, state_id, rect,
&content_rect);
- FillRect(hdc, &content_rect, bg_brush);
+ FillRect(hdc, &content_rect, bg_brush.get());
}
return hr;
}
@@ -1979,7 +1980,8 @@ HRESULT NativeThemeWin::PaintFrameControl(HDC hdc,
return E_OUTOFMEMORY;
base::win::ScopedCreateDC bitmap_dc(CreateCompatibleDC(NULL));
- base::win::ScopedSelectObject select_bitmap(bitmap_dc.Get(), mask_bitmap);
+ base::win::ScopedSelectObject select_bitmap(bitmap_dc.Get(),
+ mask_bitmap.get());
RECT local_rect = { 0, 0, width, height };
DrawFrameControl(bitmap_dc.Get(), &local_rect, type, state);
« no previous file with comments | « ui/gfx/platform_font_win.cc ('k') | ui/views/controls/menu/menu_config_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698