Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: ui/base/native_theme/native_theme_win.cc

Issue 11362061: Fixes crash in unittests. This happened as the result of making the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/native_theme/native_theme_aura.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/base/native_theme/native_theme_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698