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

Side by Side Diff: ui/views/controls/menu/menu_config_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 unified diff | Download patch
« no previous file with comments | « ui/native_theme/native_theme_win.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/menu/menu_config.h" 5 #include "ui/views/controls/menu/menu_config.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <uxtheme.h> 8 #include <uxtheme.h>
9 #include <Vssym32.h> 9 #include <Vssym32.h>
10 10
(...skipping 10 matching lines...) Expand all
21 namespace views { 21 namespace views {
22 22
23 void MenuConfig::Init() { 23 void MenuConfig::Init() {
24 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); 24 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT);
25 25
26 NONCLIENTMETRICS_XP metrics; 26 NONCLIENTMETRICS_XP metrics;
27 base::win::GetNonClientMetrics(&metrics); 27 base::win::GetNonClientMetrics(&metrics);
28 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); 28 l10n_util::AdjustUIFont(&(metrics.lfMenuFont));
29 { 29 {
30 base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont)); 30 base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont));
31 DLOG_ASSERT(new_font.Get()); 31 DLOG_ASSERT(new_font.is_valid());
32 font_list = gfx::FontList(gfx::Font(new_font)); 32 font_list = gfx::FontList(gfx::Font(new_font.get()));
33 } 33 }
34 NativeTheme::ExtraParams extra; 34 NativeTheme::ExtraParams extra;
35 extra.menu_check.is_radio = false; 35 extra.menu_check.is_radio = false;
36 extra.menu_check.is_selected = false; 36 extra.menu_check.is_selected = false;
37 gfx::Size check_size = NativeThemeWin::instance()->GetPartSize( 37 gfx::Size check_size = NativeThemeWin::instance()->GetPartSize(
38 NativeTheme::kMenuCheck, NativeTheme::kNormal, extra); 38 NativeTheme::kMenuCheck, NativeTheme::kNormal, extra);
39 if (!check_size.IsEmpty()) { 39 if (!check_size.IsEmpty()) {
40 check_width = check_size.width(); 40 check_width = check_size.width();
41 check_height = check_size.height(); 41 check_height = check_size.height();
42 } else { 42 } else {
(...skipping 23 matching lines...) Expand all
66 (SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &show_cues, 0) && 66 (SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &show_cues, 0) &&
67 show_cues == TRUE); 67 show_cues == TRUE);
68 68
69 SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &show_delay, 0); 69 SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &show_delay, 0);
70 70
71 separator_upper_height = 5; 71 separator_upper_height = 5;
72 separator_lower_height = 7; 72 separator_lower_height = 7;
73 } 73 }
74 74
75 } // namespace views 75 } // namespace views
OLDNEW
« no previous file with comments | « ui/native_theme/native_theme_win.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698