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_win.h" | 16 #include "ui/native_theme/native_theme_win.h" |
17 | 17 |
18 #if defined(USE_AURA) | 18 #if defined(USE_AURA) |
19 #include "ui/native_theme/native_theme_aura.h" | 19 #include "ui/native_theme/native_theme_aura.h" |
20 #endif | 20 #endif |
21 | 21 |
22 using ui::NativeTheme; | 22 using ui::NativeTheme; |
23 using ui::NativeThemeWin; | 23 using ui::NativeThemeWin; |
24 | 24 |
25 namespace views { | 25 namespace views { |
26 | 26 |
27 void MenuConfig::Init(const NativeTheme* theme) { | 27 void MenuConfig::Init(const NativeTheme* theme) { |
28 #if defined(USE_AURA) | 28 #if defined(USE_AURA) |
29 if (theme == ui::NativeThemeAura::instance()) { | 29 if (theme == ui::NativeThemeAura::instance()) { |
30 InitAura(); | 30 InitAura(theme); |
31 return; | 31 return; |
32 } | 32 } |
33 #endif | 33 #endif |
34 text_color = NativeThemeWin::instance()->GetThemeColorWithDefault( | 34 text_color = NativeThemeWin::instance()->GetThemeColorWithDefault( |
35 NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR, | 35 NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR, |
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; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 win_instance = new MenuConfig(NativeThemeWin::instance()); | 124 win_instance = new MenuConfig(NativeThemeWin::instance()); |
125 return *win_instance; | 125 return *win_instance; |
126 } | 126 } |
127 static MenuConfig* views_instance = NULL; | 127 static MenuConfig* views_instance = NULL; |
128 if (!views_instance) | 128 if (!views_instance) |
129 views_instance = new MenuConfig(theme); | 129 views_instance = new MenuConfig(theme); |
130 return *views_instance; | 130 return *views_instance; |
131 } | 131 } |
132 | 132 |
133 } // namespace views | 133 } // namespace views |
OLD | NEW |