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

Side by Side Diff: views/controls/menu/menu_config_win.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/listbox/native_listbox_win.cc ('k') | views/controls/menu/menu_item_view_gtk.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "views/controls/menu/menu_config.h" 5 #include "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 12 matching lines...) Expand all
23 23
24 config->text_color = NativeTheme::instance()->GetThemeColorWithDefault( 24 config->text_color = NativeTheme::instance()->GetThemeColorWithDefault(
25 NativeTheme::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR, 25 NativeTheme::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR,
26 COLOR_MENUTEXT); 26 COLOR_MENUTEXT);
27 27
28 NONCLIENTMETRICS metrics; 28 NONCLIENTMETRICS metrics;
29 win_util::GetNonClientMetrics(&metrics); 29 win_util::GetNonClientMetrics(&metrics);
30 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); 30 l10n_util::AdjustUIFont(&(metrics.lfMenuFont));
31 HFONT font = CreateFontIndirect(&metrics.lfMenuFont); 31 HFONT font = CreateFontIndirect(&metrics.lfMenuFont);
32 DLOG_ASSERT(font); 32 DLOG_ASSERT(font);
33 config->font = gfx::Font::CreateFont(font); 33 config->font = gfx::Font(font);
34 34
35 HDC dc = GetDC(NULL); 35 HDC dc = GetDC(NULL);
36 RECT bounds = { 0, 0, 200, 200 }; 36 RECT bounds = { 0, 0, 200, 200 };
37 SIZE check_size; 37 SIZE check_size;
38 if (NativeTheme::instance()->GetThemePartSize( 38 if (NativeTheme::instance()->GetThemePartSize(
39 NativeTheme::MENU, dc, MENU_POPUPCHECK, MC_CHECKMARKNORMAL, &bounds, 39 NativeTheme::MENU, dc, MENU_POPUPCHECK, MC_CHECKMARKNORMAL, &bounds,
40 TS_TRUE, &check_size) == S_OK) { 40 TS_TRUE, &check_size) == S_OK) {
41 config->check_width = check_size.cx; 41 config->check_width = check_size.cx;
42 config->check_height = check_size.cy; 42 config->check_height = check_size.cy;
43 } else { 43 } else {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ReleaseDC(NULL, dc); 92 ReleaseDC(NULL, dc);
93 93
94 BOOL show_cues; 94 BOOL show_cues;
95 config->show_mnemonics = 95 config->show_mnemonics =
96 (SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &show_cues, 0) && 96 (SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &show_cues, 0) &&
97 show_cues == TRUE); 97 show_cues == TRUE);
98 return config; 98 return config;
99 } 99 }
100 100
101 } // namespace views 101 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/listbox/native_listbox_win.cc ('k') | views/controls/menu/menu_item_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698