| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/native_theme_win.h" | 5 #include "ui/gfx/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> |
| 11 | 11 |
| 12 #include "base/basictypes.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/memory/scoped_handle.h" | 14 #include "base/memory/scoped_handle.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/win/scoped_gdi_object.h" | 16 #include "base/win/scoped_gdi_object.h" |
| 16 #include "base/win/scoped_hdc.h" | 17 #include "base/win/scoped_hdc.h" |
| 17 #include "base/win/scoped_select_object.h" | 18 #include "base/win/scoped_select_object.h" |
| 18 #include "base/win/windows_version.h" | 19 #include "base/win/windows_version.h" |
| 19 #include "skia/ext/platform_canvas.h" | 20 #include "skia/ext/platform_canvas.h" |
| 20 #include "skia/ext/skia_utils_win.h" | 21 #include "skia/ext/skia_utils_win.h" |
| 21 #include "third_party/skia/include/core/SkCanvas.h" | 22 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 59 |
| 59 namespace gfx { | 60 namespace gfx { |
| 60 | 61 |
| 61 // static | 62 // static |
| 62 const NativeTheme* NativeTheme::instance() { | 63 const NativeTheme* NativeTheme::instance() { |
| 63 return NativeThemeWin::instance(); | 64 return NativeThemeWin::instance(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 // static | 67 // static |
| 67 const NativeThemeWin* NativeThemeWin::instance() { | 68 const NativeThemeWin* NativeThemeWin::instance() { |
| 68 // The global NativeThemeWin instance. | 69 CR_DEFINE_STATIC_LOCAL(NativeThemeWin, s_native_theme, ()); |
| 69 static const NativeThemeWin s_native_theme; | |
| 70 return &s_native_theme; | 70 return &s_native_theme; |
| 71 } | 71 } |
| 72 | 72 |
| 73 NativeThemeWin::NativeThemeWin() | 73 NativeThemeWin::NativeThemeWin() |
| 74 : theme_dll_(LoadLibrary(L"uxtheme.dll")), | 74 : theme_dll_(LoadLibrary(L"uxtheme.dll")), |
| 75 draw_theme_(NULL), | 75 draw_theme_(NULL), |
| 76 draw_theme_ex_(NULL), | 76 draw_theme_ex_(NULL), |
| 77 get_theme_color_(NULL), | 77 get_theme_color_(NULL), |
| 78 get_theme_content_rect_(NULL), | 78 get_theme_content_rect_(NULL), |
| 79 get_theme_part_size_(NULL), | 79 get_theme_part_size_(NULL), |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 } | 1676 } |
| 1677 break; | 1677 break; |
| 1678 default: | 1678 default: |
| 1679 NOTREACHED() << "Invalid part: " << part; | 1679 NOTREACHED() << "Invalid part: " << part; |
| 1680 break; | 1680 break; |
| 1681 } | 1681 } |
| 1682 return state_id; | 1682 return state_id; |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 } // namespace gfx | 1685 } // namespace gfx |
| OLD | NEW |