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/base/native_theme/native_theme_win.h" | 5 #include "ui/base/native_theme/native_theme_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <uxtheme.h> | 8 #include <uxtheme.h> |
9 #include <vsstyle.h> | 9 #include <vsstyle.h> |
10 #include <vssym32.h> | 10 #include <vssym32.h> |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 bool NativeThemeWin::IsClassicTheme(ThemeName name) const { | 188 bool NativeThemeWin::IsClassicTheme(ThemeName name) const { |
189 if (!theme_dll_) | 189 if (!theme_dll_) |
190 return true; | 190 return true; |
191 | 191 |
192 return !GetThemeHandle(name); | 192 return !GetThemeHandle(name); |
193 } | 193 } |
194 | 194 |
| 195 // TODO(sky): seems like we should default to NativeThemeWin, but that currently |
| 196 // breaks a couple of tests (FocusTraversalTest.NormalTraversal in |
| 197 // views_unittests). |
| 198 #if !defined(USE_AURA) |
195 // static | 199 // static |
196 NativeTheme* NativeTheme::instance() { | 200 NativeTheme* NativeTheme::instance() { |
197 return NativeThemeWin::instance(); | 201 return NativeThemeWin::instance(); |
198 } | 202 } |
| 203 #endif |
199 | 204 |
200 // static | 205 // static |
201 NativeThemeWin* NativeThemeWin::instance() { | 206 NativeThemeWin* NativeThemeWin::instance() { |
202 CR_DEFINE_STATIC_LOCAL(NativeThemeWin, s_native_theme, ()); | 207 CR_DEFINE_STATIC_LOCAL(NativeThemeWin, s_native_theme, ()); |
203 return &s_native_theme; | 208 return &s_native_theme; |
204 } | 209 } |
205 | 210 |
206 NativeThemeWin::NativeThemeWin() | 211 NativeThemeWin::NativeThemeWin() |
207 : theme_dll_(LoadLibrary(L"uxtheme.dll")), | 212 : theme_dll_(LoadLibrary(L"uxtheme.dll")), |
208 draw_theme_(NULL), | 213 draw_theme_(NULL), |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1810 handle = open_theme_(NULL, L"Spin"); | 1815 handle = open_theme_(NULL, L"Spin"); |
1811 break; | 1816 break; |
1812 default: | 1817 default: |
1813 NOTREACHED(); | 1818 NOTREACHED(); |
1814 } | 1819 } |
1815 theme_handles_[theme_name] = handle; | 1820 theme_handles_[theme_name] = handle; |
1816 return handle; | 1821 return handle; |
1817 } | 1822 } |
1818 | 1823 |
1819 } // namespace ui | 1824 } // namespace ui |
OLD | NEW |