| 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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/win/scoped_gdi_object.h" | 12 #include "base/win/scoped_gdi_object.h" |
| 13 #include "base/win/win_util.h" | 13 #include "base/win/win_util.h" |
| 14 #include "ui/base/l10n/l10n_util_win.h" | 14 #include "ui/base/l10n/l10n_util_win.h" |
| 15 #include "ui/gfx/color_utils.h" | 15 #include "ui/gfx/color_utils.h" |
| 16 #include "ui/native_theme/native_theme_aura.h" |
| 16 #include "ui/native_theme/native_theme_win.h" | 17 #include "ui/native_theme/native_theme_win.h" |
| 17 | 18 |
| 18 #if defined(USE_AURA) | |
| 19 #include "ui/native_theme/native_theme_aura.h" | |
| 20 #endif | |
| 21 | |
| 22 using ui::NativeTheme; | 19 using ui::NativeTheme; |
| 23 using ui::NativeThemeWin; | 20 using ui::NativeThemeWin; |
| 24 | 21 |
| 25 namespace views { | 22 namespace views { |
| 26 | 23 |
| 27 void MenuConfig::Init(const NativeTheme* theme) { | 24 void MenuConfig::Init(const NativeTheme* theme) { |
| 28 #if defined(USE_AURA) | |
| 29 if (theme == ui::NativeThemeAura::instance()) { | 25 if (theme == ui::NativeThemeAura::instance()) { |
| 30 InitAura(theme); | 26 InitAura(theme); |
| 31 return; | 27 return; |
| 32 } | 28 } |
| 33 #endif | |
| 34 text_color = NativeThemeWin::instance()->GetThemeColorWithDefault( | 29 text_color = NativeThemeWin::instance()->GetThemeColorWithDefault( |
| 35 NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR, | 30 NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR, |
| 36 COLOR_MENUTEXT); | 31 COLOR_MENUTEXT); |
| 37 | 32 |
| 38 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); | 33 arrow_color = color_utils::GetSysSkColor(COLOR_MENUTEXT); |
| 39 | 34 |
| 40 NONCLIENTMETRICS metrics; | 35 NONCLIENTMETRICS metrics; |
| 41 base::win::GetNonClientMetrics(&metrics); | 36 base::win::GetNonClientMetrics(&metrics); |
| 42 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); | 37 l10n_util::AdjustUIFont(&(metrics.lfMenuFont)); |
| 43 { | 38 { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 win_instance = new MenuConfig(NativeThemeWin::instance()); | 92 win_instance = new MenuConfig(NativeThemeWin::instance()); |
| 98 return *win_instance; | 93 return *win_instance; |
| 99 } | 94 } |
| 100 static MenuConfig* views_instance = NULL; | 95 static MenuConfig* views_instance = NULL; |
| 101 if (!views_instance) | 96 if (!views_instance) |
| 102 views_instance = new MenuConfig(theme); | 97 views_instance = new MenuConfig(theme); |
| 103 return *views_instance; | 98 return *views_instance; |
| 104 } | 99 } |
| 105 | 100 |
| 106 } // namespace views | 101 } // namespace views |
| OLD | NEW |