| OLD | NEW |
| 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 11 matching lines...) Expand all Loading... |
| 22 namespace views { | 22 namespace views { |
| 23 | 23 |
| 24 void MenuConfig::Init(const NativeTheme* theme) { | 24 void MenuConfig::Init(const NativeTheme* theme) { |
| 25 if (theme == ui::NativeThemeAura::instance()) { | 25 if (theme == ui::NativeThemeAura::instance()) { |
| 26 InitAura(theme); | 26 InitAura(theme); |
| 27 return; | 27 return; |
| 28 } | 28 } |
| 29 | 29 |
| 30 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); | 30 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); |
| 31 | 31 |
| 32 NONCLIENTMETRICS metrics; | 32 NONCLIENTMETRICS_XP metrics; |
| 33 base::win::GetNonClientMetrics(&metrics); | 33 base::win::GetNonClientMetrics(&metrics); |
| 34 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); | 34 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); |
| 35 { | 35 { |
| 36 base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont)); | 36 base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont)); |
| 37 DLOG_ASSERT(new_font.Get()); | 37 DLOG_ASSERT(new_font.Get()); |
| 38 font_list = gfx::FontList(gfx::Font(new_font)); | 38 font_list = gfx::FontList(gfx::Font(new_font)); |
| 39 } | 39 } |
| 40 NativeTheme::ExtraParams extra; | 40 NativeTheme::ExtraParams extra; |
| 41 extra.menu_check.is_radio = false; | 41 extra.menu_check.is_radio = false; |
| 42 extra.menu_check.is_selected = false; | 42 extra.menu_check.is_selected = false; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 win_instance = new MenuConfig(NativeThemeWin::instance()); | 87 win_instance = new MenuConfig(NativeThemeWin::instance()); |
| 88 return *win_instance; | 88 return *win_instance; |
| 89 } | 89 } |
| 90 static MenuConfig* views_instance = NULL; | 90 static MenuConfig* views_instance = NULL; |
| 91 if (!views_instance) | 91 if (!views_instance) |
| 92 views_instance = new MenuConfig(theme); | 92 views_instance = new MenuConfig(theme); |
| 93 return *views_instance; | 93 return *views_instance; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace views | 96 } // namespace views |
| OLD | NEW |