| 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 25 matching lines...) Expand all Loading... |
| 36 COLOR_MENUTEXT); | 36 COLOR_MENUTEXT); |
| 37 | 37 |
| 38 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); | 38 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); |
| 39 | 39 |
| 40 NONCLIENTMETRICS metrics; | 40 NONCLIENTMETRICS metrics; |
| 41 base::win::GetNonClientMetrics(&metrics); | 41 base::win::GetNonClientMetrics(&metrics); |
| 42 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); | 42 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); |
| 43 { | 43 { |
| 44 base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont)); | 44 base::win::ScopedHFONT new_font(CreateFontIndirect(&metrics.lfMenuFont)); |
| 45 DLOG_ASSERT(new_font.Get()); | 45 DLOG_ASSERT(new_font.Get()); |
| 46 font = gfx::Font(new_font); | 46 font_list = gfx::FontList(gfx::Font(new_font)); |
| 47 } | 47 } |
| 48 NativeTheme::ExtraParams extra; | 48 NativeTheme::ExtraParams extra; |
| 49 extra.menu_check.is_radio = false; | 49 extra.menu_check.is_radio = false; |
| 50 extra.menu_check.is_selected = false; | 50 extra.menu_check.is_selected = false; |
| 51 gfx::Size check_size = NativeThemeWin::instance()->GetPartSize( | 51 gfx::Size check_size = NativeThemeWin::instance()->GetPartSize( |
| 52 NativeTheme::kMenuCheck, NativeTheme::kNormal, extra); | 52 NativeTheme::kMenuCheck, NativeTheme::kNormal, extra); |
| 53 if (!check_size.IsEmpty()) { | 53 if (!check_size.IsEmpty()) { |
| 54 check_width = check_size.width(); | 54 check_width = check_size.width(); |
| 55 check_height = check_size.height(); | 55 check_height = check_size.height(); |
| 56 } else { | 56 } else { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 win_instance = new MenuConfig(NativeThemeWin::instance()); | 97 win_instance = new MenuConfig(NativeThemeWin::instance()); |
| 98 return *win_instance; | 98 return *win_instance; |
| 99 } | 99 } |
| 100 static MenuConfig* views_instance = NULL; | 100 static MenuConfig* views_instance = NULL; |
| 101 if (!views_instance) | 101 if (!views_instance) |
| 102 views_instance = new MenuConfig(theme); | 102 views_instance = new MenuConfig(theme); |
| 103 return *views_instance; | 103 return *views_instance; |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace views | 106 } // namespace views |
| OLD | NEW |